🔨 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 _ from "lodash";
|
||||||
import IconComponent from "../genericIconComponent";
|
import IconComponent from "../genericIconComponent";
|
||||||
import { Input } from "../ui/input";
|
import { Input } from "../ui/input";
|
||||||
|
import { classNames } from "../../utils/utils";
|
||||||
|
|
||||||
export default function InputListComponent({
|
export default function InputListComponent({
|
||||||
value,
|
value,
|
||||||
|
|
@ -28,7 +29,13 @@ export default function InputListComponent({
|
||||||
}, [disabled, onChange]);
|
}, [disabled, onChange]);
|
||||||
|
|
||||||
return (
|
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) => {
|
{inputList.map((i, idx) => {
|
||||||
return (
|
return (
|
||||||
<div key={idx} className="flex w-full gap-3">
|
<div key={idx} className="flex w-full gap-3">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue