|
1 | | -import { Terminal, Plus, Zap, Clock, ArrowRight } from 'lucide-react' |
| 1 | +import { Terminal, Plus, Zap, Network, ArrowRight, Key, Monitor, Cpu, Shield } from 'lucide-react' |
2 | 2 | import { useAppStore } from '../store' |
3 | | -import { cn } from '../lib/utils' |
4 | 3 |
|
5 | 4 | export function WelcomeScreen(): JSX.Element { |
6 | | - const { setConnectionDialogOpen, setQuickConnectOpen, connections } = useAppStore() |
| 5 | + const { setConnectionDialogOpen, setQuickConnectOpen } = useAppStore() |
7 | 6 | const isMac = navigator.userAgent.includes('Mac') |
8 | | - const recentConnections = connections |
9 | | - .filter((c) => c.lastConnectedAt) |
10 | | - .sort((a, b) => (b.lastConnectedAt ?? 0) - (a.lastConnectedAt ?? 0)) |
11 | | - .slice(0, 5) |
| 7 | + const mod = isMac ? '⌘' : 'Ctrl+' |
| 8 | + |
| 9 | + const steps = [ |
| 10 | + { |
| 11 | + num: '1', |
| 12 | + icon: Plus, |
| 13 | + title: 'Add your first host', |
| 14 | + desc: 'Save SSH, Telnet, or Serial connections to your library.', |
| 15 | + action: { label: 'New Connection', onClick: () => setConnectionDialogOpen(true) }, |
| 16 | + }, |
| 17 | + { |
| 18 | + num: '2', |
| 19 | + icon: Zap, |
| 20 | + title: 'Or connect instantly', |
| 21 | + desc: `Use Quick Connect (${mod}K) to connect without saving.`, |
| 22 | + action: { label: 'Quick Connect', onClick: () => setQuickConnectOpen(true) }, |
| 23 | + }, |
| 24 | + { |
| 25 | + num: '3', |
| 26 | + icon: Cpu, |
| 27 | + title: 'Let ARIA assist you', |
| 28 | + desc: `Open the AI panel (${mod}⇧A) and ask ARIA to troubleshoot, configure, or explain anything on the device.`, |
| 29 | + action: null, |
| 30 | + }, |
| 31 | + ] |
| 32 | + |
| 33 | + const features = [ |
| 34 | + { icon: Network, label: 'SSH / Telnet / Serial' }, |
| 35 | + { icon: Cpu, label: 'ARIA AI Assistant' }, |
| 36 | + { icon: Shield, label: 'Encrypted vault' }, |
| 37 | + { icon: Monitor, label: 'Multi-tab + Split view' }, |
| 38 | + { icon: Key, label: 'SSH key management' }, |
| 39 | + { icon: Zap, label: 'Device auto-detection' }, |
| 40 | + ] |
12 | 41 |
|
13 | 42 | return ( |
14 | | - <div className="flex-1 flex flex-col items-center justify-center gap-10 p-8"> |
15 | | - {/* Logo + heading */} |
16 | | - <div className="flex flex-col items-center gap-4"> |
17 | | - <div className="w-14 h-14 rounded-2xl bg-primary/10 border border-primary/20 flex items-center justify-center"> |
18 | | - <Terminal className="w-7 h-7 text-primary" /> |
| 43 | + <div className="flex-1 h-full overflow-y-auto flex flex-col items-center px-6 pt-14 pb-10 gap-12 bg-background"> |
| 44 | + |
| 45 | + {/* Hero */} |
| 46 | + <div className="flex flex-col items-center gap-4 text-center max-w-sm"> |
| 47 | + <div className="w-16 h-16 rounded-2xl bg-primary/10 border border-primary/20 flex items-center justify-center shadow-lg shadow-primary/10"> |
| 48 | + <Terminal className="w-8 h-8 text-primary" /> |
19 | 49 | </div> |
20 | | - <div className="text-center space-y-1"> |
21 | | - <h1 className="text-2xl font-semibold text-foreground tracking-tight">NetCopilot</h1> |
22 | | - <p className="text-sm text-muted-foreground"> |
23 | | - Your AI-Native Network Copilot |
| 50 | + <div className="space-y-1.5"> |
| 51 | + <h1 className="text-2xl font-bold text-foreground tracking-tight"> |
| 52 | + Welcome to NetCopilot |
| 53 | + </h1> |
| 54 | + <p className="text-sm text-muted-foreground leading-relaxed"> |
| 55 | + Your AI-powered network terminal. Manage SSH, Telnet & Serial connections, |
| 56 | + all with an intelligent assistant at your side. |
24 | 57 | </p> |
25 | 58 | </div> |
26 | 59 | </div> |
27 | 60 |
|
28 | | - {/* Actions */} |
29 | | - <div className="flex flex-col gap-2 w-full max-w-xs"> |
30 | | - <button |
31 | | - onClick={() => setQuickConnectOpen(true)} |
32 | | - className="flex items-center gap-3 p-3.5 rounded-lg bg-primary text-white hover:bg-primary/90 text-left transition-colors group" |
33 | | - > |
34 | | - <Zap className="w-4 h-4 shrink-0" /> |
35 | | - <div className="flex-1 min-w-0"> |
36 | | - <p className="text-sm font-medium">Quick Connect</p> |
37 | | - <p className="text-xs opacity-75 mt-0.5"> |
38 | | - {isMac ? '⌘K' : 'Ctrl+K'} · Connect instantly |
39 | | - </p> |
40 | | - </div> |
41 | | - <ArrowRight className="w-4 h-4 opacity-0 group-hover:opacity-60 transition-opacity" /> |
42 | | - </button> |
| 61 | + {/* Getting started steps */} |
| 62 | + <div className="w-full max-w-lg space-y-3"> |
| 63 | + <p className="text-[11px] font-semibold text-muted-foreground uppercase tracking-widest mb-4"> |
| 64 | + Getting started |
| 65 | + </p> |
43 | 66 |
|
44 | | - <button |
45 | | - onClick={() => setConnectionDialogOpen(true)} |
46 | | - className="flex items-center gap-3 p-3.5 rounded-lg bg-secondary border border-border hover:bg-accent hover:border-border/80 text-left transition-colors group" |
47 | | - > |
48 | | - <Plus className="w-4 h-4 text-muted-foreground shrink-0" /> |
49 | | - <div className="flex-1 min-w-0"> |
50 | | - <p className="text-sm font-medium text-foreground">New Connection</p> |
51 | | - <p className="text-xs text-muted-foreground mt-0.5">Save to your library</p> |
52 | | - </div> |
53 | | - <ArrowRight className="w-4 h-4 text-muted-foreground opacity-0 group-hover:opacity-50 transition-opacity" /> |
54 | | - </button> |
55 | | - </div> |
| 67 | + {steps.map((step) => { |
| 68 | + const Icon = step.icon |
| 69 | + return ( |
| 70 | + <div |
| 71 | + key={step.num} |
| 72 | + className="flex items-start gap-4 p-4 rounded-xl border border-border bg-card hover:bg-accent/30 transition-colors group" |
| 73 | + > |
| 74 | + {/* Step number */} |
| 75 | + <div className="w-7 h-7 rounded-full bg-primary/10 border border-primary/20 flex items-center justify-center shrink-0 mt-0.5"> |
| 76 | + <span className="text-xs font-bold text-primary">{step.num}</span> |
| 77 | + </div> |
56 | 78 |
|
57 | | - {/* Recent connections */} |
58 | | - {recentConnections.length > 0 && ( |
59 | | - <div className="w-full max-w-xs space-y-1.5"> |
60 | | - <div className="flex items-center gap-1.5 mb-2"> |
61 | | - <Clock className="w-3 h-3 text-muted-foreground/60" /> |
62 | | - <p className="text-[11px] font-semibold text-muted-foreground/60 uppercase tracking-widest">Recent</p> |
63 | | - </div> |
64 | | - <div className="flex flex-col gap-0.5"> |
65 | | - {recentConnections.map((conn) => ( |
66 | | - <RecentConnectionItem key={conn.id} connection={conn} /> |
67 | | - ))} |
68 | | - </div> |
69 | | - </div> |
70 | | - )} |
71 | | - </div> |
72 | | - ) |
73 | | -} |
74 | | - |
75 | | -function RecentConnectionItem({ connection }: { connection: import('../types').Connection }): JSX.Element { |
76 | | - const { openSession } = useAppStore() |
| 79 | + {/* Content */} |
| 80 | + <div className="flex-1 min-w-0"> |
| 81 | + <div className="flex items-center gap-2 mb-0.5"> |
| 82 | + <Icon className="w-3.5 h-3.5 text-primary shrink-0" /> |
| 83 | + <p className="text-sm font-semibold text-foreground">{step.title}</p> |
| 84 | + </div> |
| 85 | + <p className="text-xs text-muted-foreground leading-relaxed">{step.desc}</p> |
| 86 | + </div> |
77 | 87 |
|
78 | | - const protocolColor: Record<string, string> = { |
79 | | - ssh: 'text-violet-400', |
80 | | - telnet: 'text-amber-400', |
81 | | - serial: 'text-emerald-400', |
82 | | - } |
| 88 | + {/* CTA */} |
| 89 | + {step.action && ( |
| 90 | + <button |
| 91 | + onClick={step.action.onClick} |
| 92 | + className="shrink-0 flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-primary/10 text-primary text-xs font-medium hover:bg-primary/20 transition-colors cursor-pointer whitespace-nowrap" |
| 93 | + > |
| 94 | + {step.action.label} |
| 95 | + <ArrowRight className="w-3 h-3" /> |
| 96 | + </button> |
| 97 | + )} |
| 98 | + </div> |
| 99 | + ) |
| 100 | + })} |
| 101 | + </div> |
83 | 102 |
|
84 | | - return ( |
85 | | - <button |
86 | | - onClick={() => openSession(connection)} |
87 | | - className={cn( |
88 | | - 'flex items-center gap-3 px-3 py-2 rounded-md hover:bg-secondary text-left transition-colors group' |
89 | | - )} |
90 | | - > |
91 | | - <span |
92 | | - className="w-2 h-2 rounded-full shrink-0" |
93 | | - style={{ backgroundColor: connection.color || '#8b5cf6' }} |
94 | | - /> |
95 | | - <div className="flex-1 min-w-0"> |
96 | | - <p className="text-sm font-medium text-foreground truncate">{connection.name}</p> |
97 | | - <p className="text-xs text-muted-foreground truncate"> |
98 | | - {connection.username}@{connection.host} |
| 103 | + {/* Feature highlights */} |
| 104 | + <div className="w-full max-w-lg"> |
| 105 | + <p className="text-[11px] font-semibold text-muted-foreground uppercase tracking-widest mb-4"> |
| 106 | + What's included |
99 | 107 | </p> |
| 108 | + <div className="grid grid-cols-2 sm:grid-cols-3 gap-2.5"> |
| 109 | + {features.map(({ icon: Icon, label }) => ( |
| 110 | + <div |
| 111 | + key={label} |
| 112 | + className="flex items-center gap-2.5 px-3.5 py-2.5 rounded-lg border border-border bg-card/50" |
| 113 | + > |
| 114 | + <Icon className="w-3.5 h-3.5 text-primary/70 shrink-0" /> |
| 115 | + <span className="text-xs text-muted-foreground font-medium truncate">{label}</span> |
| 116 | + </div> |
| 117 | + ))} |
| 118 | + </div> |
100 | 119 | </div> |
101 | | - <span className={cn('text-[10px] font-semibold uppercase tracking-wider shrink-0', protocolColor[connection.protocol] ?? 'text-muted-foreground')}> |
102 | | - {connection.protocol} |
103 | | - </span> |
104 | | - </button> |
| 120 | + |
| 121 | + {/* Keyboard hint */} |
| 122 | + <p className="text-xs text-muted-foreground/50 text-center"> |
| 123 | + Press <kbd className="px-1.5 py-0.5 rounded bg-muted border border-border text-[10px] font-mono">?</kbd> anytime to see all keyboard shortcuts |
| 124 | + </p> |
| 125 | + </div> |
105 | 126 | ) |
106 | 127 | } |
0 commit comments