- Add playwright.config.storybook.ts: runs against storybook-static on :6007 - Add e2e/tests/storybook/storybook-all.spec.ts: one test per story (load iframe, no errors) - Add scripts/serve-storybook-static.cjs: serves build or stub (empty index) when no build - npm run test:storybook:playwright (after build-storybook) for full coverage - Storybook decorator: use bg-background / design tokens for dark (#121212) - Preview: default dark background #121212 - Button: secondary/ghost/glass aligned to Spotify/Discord (white/5, white/10 hover) - KodoEmptyState: softer orbs, compact copy, primary CTA without heavy glow Co-authored-by: Cursor <cursoragent@cursor.com>
58 lines
1.8 KiB
TypeScript
58 lines
1.8 KiB
TypeScript
import { Card } from '@/components/ui/card';
|
|
import { Button } from '@/components/ui/button';
|
|
import { LucideIcon } from 'lucide-react';
|
|
import { cn } from '@/lib/utils';
|
|
|
|
interface KodoEmptyStateProps {
|
|
icon: LucideIcon;
|
|
title: string;
|
|
description: string;
|
|
actionLabel?: string;
|
|
onAction?: () => void;
|
|
className?: string;
|
|
}
|
|
|
|
export function KodoEmptyState({
|
|
icon: Icon,
|
|
title,
|
|
description,
|
|
actionLabel,
|
|
onAction,
|
|
className,
|
|
}: KodoEmptyStateProps) {
|
|
return (
|
|
<Card
|
|
variant="surface"
|
|
className={cn(
|
|
'flex flex-col items-center justify-center text-center p-8 sm:p-16 animate-fade-in relative overflow-hidden group',
|
|
className,
|
|
)}
|
|
>
|
|
{/* Subtle ambient orbs */}
|
|
<div className="absolute inset-0 opacity-[0.12] group-hover:opacity-20 transition-opacity duration-500 pointer-events-none">
|
|
<div className="absolute top-1/4 left-1/4 w-64 h-64 bg-primary/40 rounded-full blur-3xl" />
|
|
<div className="absolute bottom-1/4 right-1/4 w-64 h-64 bg-primary/30 rounded-full blur-3xl" />
|
|
</div>
|
|
|
|
<div className="relative mb-6 p-4">
|
|
<div className="relative bg-white/5 p-5 rounded-xl border border-white/10 flex items-center justify-center group-hover:border-white/15 transition-colors">
|
|
<Icon className="h-10 w-10 text-primary" />
|
|
</div>
|
|
</div>
|
|
|
|
<h3 className="text-xl font-semibold text-foreground mb-2 tracking-tight relative z-10">
|
|
{title}
|
|
</h3>
|
|
|
|
<p className="text-muted-foreground max-w-sm mb-6 text-sm leading-relaxed relative z-10">
|
|
{description}
|
|
</p>
|
|
|
|
{actionLabel && onAction && (
|
|
<Button variant="primary" size="sm" onClick={onAction}>
|
|
{actionLabel}
|
|
</Button>
|
|
)}
|
|
</Card>
|
|
);
|
|
}
|