fix(web): hide header Create CTA on the automations empty state

The empty-state card already hosts the primary "Create via chat" CTA;
keeping the header button on the same screen showed two identical
buttons. Adds an optional ``showCreateCta`` prop to AutomationsHeader
(default true) and turns it off only in the empty branch so the card
stays the focal point.
This commit is contained in:
CREDO23 2026-05-28 01:14:10 +02:00
parent 7bc52dcdc0
commit bc3c2fd515
2 changed files with 9 additions and 1 deletions

View file

@ -75,6 +75,7 @@ export function AutomationsContent({ searchSpaceId }: AutomationsContentProps) {
total={0}
loading={false}
canCreate={perms.canCreate}
showCreateCta={false}
/>
<AutomationsEmptyState searchSpaceId={searchSpaceId} canCreate={perms.canCreate} />
</>

View file

@ -8,6 +8,12 @@ interface AutomationsHeaderProps {
total: number;
loading: boolean;
canCreate: boolean;
/**
* Render the header's Create CTA. Defaults to true; the empty state owns
* the primary CTA on its own card, so the orchestrator turns this off
* there to avoid a duplicate button.
*/
showCreateCta?: boolean;
}
/**
@ -20,6 +26,7 @@ export function AutomationsHeader({
total,
loading,
canCreate,
showCreateCta = true,
}: AutomationsHeaderProps) {
return (
<div className="flex items-center justify-between gap-4 flex-wrap">
@ -31,7 +38,7 @@ export function AutomationsHeader({
</span>
)}
</div>
{canCreate && (
{canCreate && showCreateCta && (
<Button asChild size="sm">
<Link href={`/dashboard/${searchSpaceId}/new-chat`}>
<MessageSquarePlus className="mr-2 h-4 w-4" />