feat(03-02): add EmptyState component and wire into Dashboard and Categories pages

- Create shared EmptyState component with icon, heading, subtext, and optional CTA button
- DashboardPage: show EmptyState when no budgets exist with Create CTA; replace plain Card fallback with EmptyState for no-current-budget case
- CategoriesPage: add loading state to prevent empty-state flash on initial load; show EmptyState when no categories exist
This commit is contained in:
2026-03-11 22:32:34 +01:00
parent 30ec2d5780
commit 4fc63893b8
3 changed files with 105 additions and 14 deletions

View File

@@ -0,0 +1,21 @@
import { Button } from '@/components/ui/button'
interface EmptyStateProps {
icon: React.ElementType
heading: string
subtext: string
action?: { label: string; onClick: () => void }
}
export function EmptyState({ icon: Icon, heading, subtext, action }: EmptyStateProps) {
return (
<div className="flex flex-col items-center justify-center py-16 text-center">
<Icon className="size-12 text-muted-foreground mb-4" />
<h2 className="font-semibold text-lg mb-1">{heading}</h2>
<p className="text-sm text-muted-foreground mb-4">{subtext}</p>
{action && (
<Button onClick={action.onClick}>{action.label}</Button>
)}
</div>
)
}