web/app/components/ui/empty-state.tsxblame
View source
4dfd09b1import Link from "next/link";
4dfd09b2
4dfd09b3export interface EmptyStateProps {
4dfd09b4 icon?: React.ReactNode;
4dfd09b5 title: string;
4dfd09b6 description?: string;
4dfd09b7 action?: {
4dfd09b8 label: string;
4dfd09b9 href?: string;
4dfd09b10 onClick?: () => void;
4dfd09b11 };
4dfd09b12 className?: string;
4dfd09b13}
4dfd09b14
4dfd09b15export function EmptyState({
4dfd09b16 icon,
4dfd09b17 title,
4dfd09b18 description,
4dfd09b19 action,
4dfd09b20 className = "",
4dfd09b21}: EmptyStateProps) {
4dfd09b22 return (
4dfd09b23 <div
4dfd09b24 className={`py-12 text-center ${className}`}
4dfd09b25 style={{
4dfd09b26 backgroundColor: "var(--bg-card)",
4dfd09b27 border: "1px solid var(--border-subtle)",
4dfd09b28 }}
4dfd09b29 >
4dfd09b30 {icon && (
4dfd09b31 <div className="flex justify-center mb-4" style={{ opacity: 0.4 }}>
4dfd09b32 {icon}
4dfd09b33 </div>
4dfd09b34 )}
4dfd09b35 <p className="text-sm" style={{ color: "var(--text-secondary)" }}>
4dfd09b36 {title}
4dfd09b37 </p>
4dfd09b38 {description && (
4dfd09b39 <p
4dfd09b40 className="text-xs mt-1"
4dfd09b41 style={{ color: "var(--text-faint)" }}
4dfd09b42 >
4dfd09b43 {description}
4dfd09b44 </p>
4dfd09b45 )}
4dfd09b46 {action && (
4dfd09b47 <div className="mt-4">
4dfd09b48 {action.href ? (
4dfd09b49 <Link
4dfd09b50 href={action.href}
4dfd09b51 className="text-sm px-3 py-1.5 inline-block"
4dfd09b52 style={{
4dfd09b53 backgroundColor: "var(--accent)",
4dfd09b54 color: "var(--accent-text)",
4dfd09b55 }}
4dfd09b56 >
4dfd09b57 {action.label}
4dfd09b58 </Link>
4dfd09b59 ) : (
4dfd09b60 <button
4dfd09b61 onClick={action.onClick}
4dfd09b62 className="text-sm px-3 py-1.5"
4dfd09b63 style={{
4dfd09b64 backgroundColor: "var(--accent)",
4dfd09b65 color: "var(--accent-text)",
4dfd09b66 cursor: "pointer",
4dfd09b67 font: "inherit",
4dfd09b68 border: "none",
4dfd09b69 }}
4dfd09b70 >
4dfd09b71 {action.label}
4dfd09b72 </button>
4dfd09b73 )}
4dfd09b74 </div>
4dfd09b75 )}
4dfd09b76 </div>
4dfd09b77 );
4dfd09b78}