🔨 refactor(inputListComponent): extract classNames function to improve code readability and reusability
🐛 fix(inputListComponent): add conditional styling to the parent div based on the length of inputList and the presence of editNode to fix layout issues
This commit is contained in:
parent
207ed3b0f0
commit
df14fd0d58
1 changed files with 8 additions and 1 deletions
|
|
@ -4,6 +4,7 @@ import { InputListComponentType } from "../../types/components";
|
|||
import _ from "lodash";
|
||||
import IconComponent from "../genericIconComponent";
|
||||
import { Input } from "../ui/input";
|
||||
import { classNames } from "../../utils/utils";
|
||||
|
||||
export default function InputListComponent({
|
||||
value,
|
||||
|
|
@ -28,7 +29,13 @@ export default function InputListComponent({
|
|||
}, [disabled, onChange]);
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-3">
|
||||
<div
|
||||
className={
|
||||
classNames(
|
||||
inputList.length > 1 && editNode ? "my-1" : "",
|
||||
"flex flex-col gap-3"
|
||||
)
|
||||
}>
|
||||
{inputList.map((i, idx) => {
|
||||
return (
|
||||
<div key={idx} className="flex w-full gap-3">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue