Skip to content

Scheduling infrastructure for absolutely everyone.

show icon button when one item in array (#22054)

sean-brydonf8d48a341d1c
diff --git a/packages/ui/components/card/FormCard.tsx b/packages/ui/components/card/FormCard.tsx
index 4cc71a24207..8570dafa966 100644
--- a/packages/ui/components/card/FormCard.tsx
+++ b/packages/ui/components/card/FormCard.tsx
@@ -44,6 +44,23 @@ const FormCardActions = ({ deleteField, duplicateField }: FormCardActionsProps)
if (actions.length === 0) return null;
+ // If only one action, show a single icon button
+ if (actions.length === 1) {
+ const action = actions[0];
+ return (
+ <Button
+ type="button"
+ variant="icon"
+ color={action.color || "minimal"}
+ className="ml-2"
+ onClick={action.onClick}
+ StartIcon={action.icon}
+ title={action.label}
+ />
+ );
+ }
+
+ // If multiple actions, show dropdown
return (
<Dropdown>
<DropdownMenuTrigger asChild>