mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-29 19:35:20 +02:00
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:
parent
7bc52dcdc0
commit
bc3c2fd515
2 changed files with 9 additions and 1 deletions
|
|
@ -75,6 +75,7 @@ export function AutomationsContent({ searchSpaceId }: AutomationsContentProps) {
|
||||||
total={0}
|
total={0}
|
||||||
loading={false}
|
loading={false}
|
||||||
canCreate={perms.canCreate}
|
canCreate={perms.canCreate}
|
||||||
|
showCreateCta={false}
|
||||||
/>
|
/>
|
||||||
<AutomationsEmptyState searchSpaceId={searchSpaceId} canCreate={perms.canCreate} />
|
<AutomationsEmptyState searchSpaceId={searchSpaceId} canCreate={perms.canCreate} />
|
||||||
</>
|
</>
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,12 @@ interface AutomationsHeaderProps {
|
||||||
total: number;
|
total: number;
|
||||||
loading: boolean;
|
loading: boolean;
|
||||||
canCreate: 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,
|
total,
|
||||||
loading,
|
loading,
|
||||||
canCreate,
|
canCreate,
|
||||||
|
showCreateCta = true,
|
||||||
}: AutomationsHeaderProps) {
|
}: AutomationsHeaderProps) {
|
||||||
return (
|
return (
|
||||||
<div className="flex items-center justify-between gap-4 flex-wrap">
|
<div className="flex items-center justify-between gap-4 flex-wrap">
|
||||||
|
|
@ -31,7 +38,7 @@ export function AutomationsHeader({
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
{canCreate && (
|
{canCreate && showCreateCta && (
|
||||||
<Button asChild size="sm">
|
<Button asChild size="sm">
|
||||||
<Link href={`/dashboard/${searchSpaceId}/new-chat`}>
|
<Link href={`/dashboard/${searchSpaceId}/new-chat`}>
|
||||||
<MessageSquarePlus className="mr-2 h-4 w-4" />
|
<MessageSquarePlus className="mr-2 h-4 w-4" />
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue