diff --git a/packages/slice-machine/src/legacy/lib/models/common/widgets/Link/components.tsx b/packages/slice-machine/src/legacy/lib/models/common/widgets/Link/components.tsx index a2e03423a..cb697be2a 100644 --- a/packages/slice-machine/src/legacy/lib/models/common/widgets/Link/components.tsx +++ b/packages/slice-machine/src/legacy/lib/models/common/widgets/Link/components.tsx @@ -2,6 +2,7 @@ import { Box, Button, Icon, + IconButton, Switch, Text, TextInput, @@ -119,6 +120,8 @@ export function Variants({ const addButtonShown = (variants?.length ?? 0) < 5; + const deleteButtonShown = (variants?.length ?? 0) > 2; + return ( {variants?.map((variant, position) => ( - - - onVariantsChange( - variants?.map((variant, index) => - index === position ? newVariant : variant, - ), - ) - } - /> + + + + onVariantsChange( + variants?.map((variant, index) => + index === position ? newVariant : variant, + ), + ) + } + /> + + {deleteButtonShown && ( + + onVariantsChange( + variants?.filter((_, index) => index !== position), + ) + } + /> + )} ))} {addButtonShown && (