Skip to content
Source
Sign inSign up
TanStack/ai
Open History to see the last commit

Empty.tsx

33 lines982 Bytes

1import { Inbox, FileQuestion, Database, BarChart3 } from 'lucide-react'
2import type { EmptyProps } from '@/lib/reports/types'
3​
4const iconMap: Record<string, React.ComponentType<{ className?: string }>> = {
5 inbox: Inbox,
6 file: FileQuestion,
7 database: Database,
8 chart: BarChart3,
9}
10​
11export function Empty({
12 title = 'No data',
13 description,
14 icon = 'inbox',
15}: EmptyProps) {
16 const IconComponent = iconMap[icon] || Inbox
17​
18 return (
19 <div className="flex flex-col items-center justify-center py-12 px-4 text-center">
20 <div className="w-12 h-12 rounded-full bg-sky-100/60 flex items-center justify-center mb-4">
21 <IconComponent className="w-6 h-6 text-[var(--report-text-muted)]" />
22 </div>
23 <h3 className="text-lg font-medium text-[var(--report-text)] mb-1">
24 {title}
25 </h3>
26 {description && (
27 <p className="text-sm text-[var(--report-text-muted)] max-w-sm">
28 {description}
29 </p>
30 )}
31 </div>
32 )