Spaces:
Runtime error
Runtime error
File size: 7,123 Bytes
6086e71 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 | import { motion } from 'framer-motion';
import {
BarChart3,
DatabaseZap,
GitBranch,
ShieldCheck,
Sparkles,
Workflow,
ArrowRight,
Search,
Zap,
Eye
} from 'lucide-react';
const PROMPTS = [
{
icon: BarChart3,
title: 'Expansion revenue',
query: 'Show net revenue retention by customer segment for the last 4 quarters',
color: '#6366f1',
},
{
icon: Workflow,
title: 'Pipeline quality',
query: 'Which opportunities have high ARR but stalled for more than 30 days?',
color: '#06b6d4',
},
{
icon: GitBranch,
title: 'Support impact',
query: 'Compare churn risk for customers with critical tickets versus healthy accounts',
color: '#a78bfa',
},
{
icon: DatabaseZap,
title: 'Product usage',
query: 'Rank workspaces by query volume, failed executions, and active users this month',
color: '#34d399',
},
];
const CAPABILITIES = [
{ icon: Search, label: 'Hybrid RAG', desc: 'Vector + BM25 retrieval combined' },
{ icon: Zap, label: 'Smart routing', desc: 'Picks the best LLM for the task' },
{ icon: ShieldCheck, label: 'SQL guardrails', desc: 'Read-only, validated before execution' },
{ icon: Eye, label: 'Full transparency', desc: 'See every step of the pipeline' },
];
export default function WelcomeScreen({ onPrompt }) {
return (
<div className="relative flex min-h-full flex-col items-center justify-center px-4 py-10">
{/* Background radial glow */}
<div className="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[500px] h-[500px] pointer-events-none opacity-20 filter blur-[120px]"
style={{ background: 'radial-gradient(circle, var(--brand) 0%, transparent 70%)' }} />
{/* Hero section */}
<div className="w-full max-w-2xl mx-auto text-center mb-8 relative z-10">
<motion.div
initial={{ opacity: 0, y: 10 }}
animate={{ opacity: 1, y: 0 }}
className="inline-flex items-center gap-2 rounded-full px-3.5 py-1.5 text-xs font-semibold mb-6"
style={{
background: 'var(--brand-dim)',
border: '1px solid rgba(99, 102, 241, 0.2)',
color: 'var(--brand-light)',
}}
>
<Sparkles size={12} className="text-brand-light" />
AI-driven SQL reasoning & execution engine
</motion.div>
<motion.h2
initial={{ opacity: 0, y: 12 }}
animate={{ opacity: 1, y: 0 }}
transition={{ delay: 0.04 }}
className="text-3xl md:text-4xl font-extrabold leading-tight text-white mb-4 tracking-tight"
>
Ask the business question.
<br />
<span className="text-gradient">PlainSQL constructs the answer.</span>
</motion.h2>
<motion.p
initial={{ opacity: 0, y: 12 }}
animate={{ opacity: 1, y: 0 }}
transition={{ delay: 0.08 }}
className="text-t3 text-sm leading-relaxed max-w-lg mx-auto font-medium"
>
Retrieving schemas, compiling SQL, validating queries, and synthesizing reports —
monitored in real-time with full transparency.
</motion.p>
</div>
{/* Capabilities row */}
<motion.div
initial={{ opacity: 0, y: 10 }}
animate={{ opacity: 1, y: 0 }}
transition={{ delay: 0.12 }}
className="w-full max-w-2xl mx-auto grid grid-cols-2 sm:grid-cols-4 gap-2 mb-8 relative z-10"
>
{CAPABILITIES.map((item, i) => {
const IconComp = item.icon;
return (
<motion.div
key={item.label}
initial={{ opacity: 0, y: 10 }}
animate={{ opacity: 1, y: 0 }}
transition={{ delay: 0.14 + i * 0.04 }}
className="rounded-xl p-3 text-center bg-surface-1 border border-border-1 hover:border-border-2 transition-all hover:bg-surface-hover"
>
<div className="w-8 h-8 rounded-lg bg-white/[0.03] border border-white/[0.05] flex items-center justify-center mx-auto mb-2 text-brand-light">
<IconComp size={15} />
</div>
<p className="text-xs font-semibold text-t2 mb-0.5">{item.label}</p>
<p className="text-[10px] text-t4 leading-normal font-medium hidden sm:block">{item.desc}</p>
</motion.div>
);
})}
</motion.div>
{/* Prompt cards */}
<div className="w-full max-w-2xl mx-auto relative z-10">
<motion.p
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}
transition={{ delay: 0.2 }}
className="text-[10px] font-bold uppercase tracking-widest text-t4 mb-3 px-1"
>
Featured templates
</motion.p>
<div className="grid gap-2 sm:grid-cols-2">
{PROMPTS.map(({ icon: Icon, title, query, color }, i) => (
<motion.button
key={query}
initial={{ opacity: 0, y: 12 }}
animate={{ opacity: 1, y: 0 }}
transition={{ delay: 0.22 + i * 0.05, duration: 0.3 }}
whileHover={{ y: -2, boxShadow: `0 8px 30px ${color}10` }}
whileTap={{ scale: 0.99 }}
onClick={() => onPrompt(query)}
className="group rounded-xl p-4 text-left transition-all border border-border-1 bg-surface-1 hover:bg-surface-hover focus-ring"
onMouseEnter={e => {
e.currentTarget.style.borderColor = `${color}40`;
}}
onMouseLeave={e => {
e.currentTarget.style.borderColor = 'var(--border-1)';
}}
>
<div className="flex items-start gap-3">
<div
className="mt-0.5 rounded-lg p-2 flex-shrink-0 transition-colors"
style={{
background: `${color}12`,
border: `1px solid ${color}20`,
}}
>
<Icon size={15} style={{ color }} />
</div>
<div className="min-w-0 flex-1">
<p className="text-xs font-bold text-white mb-1 flex items-center gap-1.5 uppercase tracking-wider">
{title}
<ArrowRight size={11} className="text-brand-light group-hover:translate-x-0.5 transition-all opacity-0 group-hover:opacity-100" />
</p>
<p className="text-xs leading-relaxed text-t3 group-hover:text-t2 transition-colors font-medium">{query}</p>
</div>
</div>
</motion.button>
))}
</div>
{/* Security note */}
<motion.div
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}
transition={{ delay: 0.5 }}
className="mt-5 flex items-center justify-center gap-2 py-2 text-xs text-t4 font-semibold"
>
<ShieldCheck size={14} className="text-success" />
Strict read-only safety guardrails & SQL parsing applied
</motion.div>
</div>
</div>
);
}
|