refactor: Update InputListComponent to fix button behavior

Fix the button behavior in the InputListComponent to correctly handle the index comparison. Previously, the button was only rendered for the first element in the list, but now it is rendered for the last element. This change ensures consistent rendering and improves the user experience when interacting with the component.
This commit is contained in:
anovazzi1 2024-06-13 10:53:22 -03:00
commit 8a98f4c53d

View file

@ -31,7 +31,7 @@ export default function InputListComponent({
<div
className={classNames(
value.length > 1 && editNode ? "my-1" : "",
"flex flex-col gap-3"
"flex flex-col gap-3",
)}
>
{value.map((singleValue, idx) => {
@ -53,7 +53,7 @@ export default function InputListComponent({
idx
}
/>
{idx === value.length - 1 ? (
{idx === 0 ? (
<button
onClick={(e) => {
let newInputList = _.cloneDeep(value);