ui: show no-agents banner on dashboard with link to onboarding step 2
When a company has no agents (e.g. user exited onboarding early), the dashboard now shows an amber banner: "You have no agents. Create one here" that opens the onboarding wizard directly at step 2 (agent creation), skipping the company creation step. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -90,7 +90,7 @@ export function Companies() {
|
||||
return (
|
||||
<div className="space-y-6">
|
||||
<div className="flex items-center justify-end">
|
||||
<Button size="sm" onClick={openOnboarding}>
|
||||
<Button size="sm" onClick={() => openOnboarding()}>
|
||||
<Plus className="h-3.5 w-3.5 mr-1.5" />
|
||||
New Company
|
||||
</Button>
|
||||
|
||||
@@ -182,10 +182,29 @@ export function Dashboard() {
|
||||
return <PageSkeleton variant="dashboard" />;
|
||||
}
|
||||
|
||||
const hasNoAgents = agents !== undefined && agents.length === 0;
|
||||
|
||||
return (
|
||||
<div className="space-y-6">
|
||||
{error && <p className="text-sm text-destructive">{error.message}</p>}
|
||||
|
||||
{hasNoAgents && (
|
||||
<div className="flex items-center justify-between gap-3 rounded-md border border-amber-300 bg-amber-50 px-4 py-3 dark:border-amber-500/25 dark:bg-amber-950/60">
|
||||
<div className="flex items-center gap-2.5">
|
||||
<Bot className="h-4 w-4 text-amber-600 dark:text-amber-400 shrink-0" />
|
||||
<p className="text-sm text-amber-900 dark:text-amber-100">
|
||||
You have no agents.
|
||||
</p>
|
||||
</div>
|
||||
<button
|
||||
onClick={() => openOnboarding({ initialStep: 2, companyId: selectedCompanyId! })}
|
||||
className="text-sm font-medium text-amber-700 hover:text-amber-900 dark:text-amber-300 dark:hover:text-amber-100 underline underline-offset-2 shrink-0"
|
||||
>
|
||||
Create one here
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<ActiveAgentsPanel companyId={selectedCompanyId!} />
|
||||
|
||||
{data && (
|
||||
|
||||
Reference in New Issue
Block a user