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

EmptyReportState.tsx

82 lines3.1 KB

1'use client'
2​
3import { FileText, Sparkles, BarChart3, Table2 } from 'lucide-react'
4​
5interface EmptyReportStateProps {
6 onSuggestionClick?: (suggestion: string) => void
7}
8​
9const SUGGESTIONS = [
10 {
11 icon: BarChart3,
12 label: 'Compare Libraries',
13 prompt: 'Create a report comparing zustand, jotai, and redux-toolkit',
14 },
15 {
16 icon: Table2,
17 label: 'Package Analysis',
18 prompt: 'Create a detailed report analyzing @tanstack/query',
19 },
20 {
21 icon: Sparkles,
22 label: 'Framework Battle',
23 prompt: 'Create a report comparing React, Vue, and Svelte popularity',
24 },
26​
27export function EmptyReportState({ onSuggestionClick }: EmptyReportStateProps) {
28 return (
29 <div className="flex flex-col items-center justify-center h-full text-center px-8">
30 {/* Icon */}
31 <div className="relative mb-6">
32 <div className="w-20 h-20 rounded-2xl bg-gradient-to-br from-cyan-500/20 to-purple-500/20 border border-cyan-500/20 flex items-center justify-center">
33 <FileText className="w-10 h-10 text-cyan-400" />
34 </div>
35 <div className="absolute -top-1 -right-1 w-6 h-6 rounded-full bg-purple-500/30 border border-purple-400/50 flex items-center justify-center">
36 <Sparkles className="w-3 h-3 text-purple-300" />
37 </div>
38 </div>
39​
40 {/* Text */}
41 <h2 className="text-2xl font-bold text-white mb-3">Create a Report</h2>
42 <p className="text-gray-400 max-w-md mb-8 leading-relaxed">
43 Ask the AI to create interactive reports with charts, metrics, and data
44 tables. Watch as components build up in real-time!
45 </p>
46​
47 {/* Suggestions */}
48 <div className="w-full max-w-lg space-y-2">
49 <p className="text-xs text-gray-500 uppercase tracking-wider mb-3">
50 Try these examples
51 </p>
52 {SUGGESTIONS.map((suggestion) => (
53 <button
54 key={suggestion.label}
55 onClick={() => onSuggestionClick?.(suggestion.prompt)}
56 className="w-full flex items-center gap-4 px-4 py-3 rounded-xl bg-gray-800/50 hover:bg-gray-800 border border-gray-700/50 hover:border-cyan-500/30 text-left transition-all group"
57 >
58 <div className="w-10 h-10 rounded-lg bg-gray-700/50 group-hover:bg-cyan-500/20 flex items-center justify-center transition-colors">
59 <suggestion.icon className="w-5 h-5 text-gray-400 group-hover:text-cyan-400 transition-colors" />
60 </div>
61 <div className="flex-1">
62 <p className="text-sm font-medium text-white">
63 {suggestion.label}
64 </p>
65 <p className="text-xs text-gray-500 line-clamp-1">
66 {suggestion.prompt}
67 </p>
68 </div>
69 </button>
70 ))}
71 </div>
72​
73 {/* Tip */}
74 <div className="mt-8 px-4 py-3 rounded-lg bg-purple-500/10 border border-purple-500/20 max-w-md">
75 <p className="text-xs text-purple-300">
76 <span className="font-medium">Pro tip:</span> You can ask the AI to
77 modify existing reports by referencing them by name.
78 </p>
79 </div>
80 </div>
81 )