veza/apps/web/src/components/ui/KodoEmptyState.tsx

65 lines
2.2 KiB
TypeScript
Raw Normal View History

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 gradient orbs */}
<div className="absolute inset-0 opacity-20 group-hover:opacity-30 transition-opacity duration-700 pointer-events-none">
<div className="absolute top-1/4 left-1/4 w-64 h-64 bg-primary/30 rounded-full blur-[80px] animate-pulse-slow" />
<div className="absolute bottom-1/4 right-1/4 w-64 h-64 bg-primary/20 rounded-full blur-[80px] animate-pulse-slow delay-700" />
</div>
<div className="relative mb-8 p-6">
<div className="relative bg-card/80 backdrop-blur-xl p-6 rounded-xl border border-white/10 group-hover:scale-105 transition-transform duration-[var(--duration-immersive)] ease-in-out flex items-center justify-center">
<Icon className="h-12 w-12 text-primary" />
</div>
</div>
<h3 className="text-2xl font-display font-bold text-foreground mb-3 tracking-tight relative z-10">
{title}
</h3>
<p className="text-muted-foreground max-w-sm mb-8 text-base leading-relaxed relative z-10">
{description}
</p>
{actionLabel && onAction && (
<Button
variant="primary"
className="rounded-xl shadow-[0_0_20px_var(--color-primary)/0.25] hover:shadow-[0_0_24px_var(--color-primary)/0.35] transition-all duration-[var(--duration-immersive)] ease-in-out"
onClick={onAction}
>
<span className="flex items-center gap-2 font-bold tracking-wide">
{actionLabel}
</span>
</Button>
)}
</Card>
);
}