1'use client';
2
3import { Drawer } from '@/components/ui/drawer';
4
5const panels = [
6 {
7 side: 'top',
8 trigger: 'Release notes',
9 title: 'What changed in v2.14',
10 description: 'Shipped to production on Mar 14.',
11 items: [
12 'Deploy logs now stream while the build runs',
13 'Region picker moved into project settings',
14 'Fixed stale cache on custom domains',
15 ],
16 action: 'Got it',
17 },
18 {
19 side: 'right',
20 trigger: 'Filters',
21 title: 'Filter deploys',
22 description: '1,204 deploys in this project.',
23 items: ['Production only', 'Failed builds', 'Last 7 days'],
24 action: 'Apply filters',
25 },
26 {
27 side: 'bottom',
28 trigger: 'Quick actions',
29 title: 'Run a task',
30 description: 'Nothing here leaves the dashboard.',
31 items: ['Redeploy the latest commit', 'Roll back to v2.13.4', 'Clear the build cache'],
32 action: 'Close',
33 },
34 {
35 side: 'left',
36 trigger: 'Workspace',
37 title: 'Northwind',
38 description: 'Pro plan, 12 of 20 seats used.',
39 items: ['Projects', 'Deployments', 'Usage and billing'],
40 action: 'Close',
41 },
42] as const;
43
44export function Positions() {
45 return (
46 <div className="grid w-full max-w-md grid-cols-2 gap-4">
47 {panels.map((panel) => (
48 <Drawer key={panel.side}>
49 <Drawer.Trigger variant="outline" className="w-full justify-between gap-2">
50 {panel.trigger}
51 <span className="text-muted-foreground text-xs">{panel.side}</span>
52 </Drawer.Trigger>
53 <Drawer.Content side={panel.side}>
54 <Drawer.Header>
55 <Drawer.Title>{panel.title}</Drawer.Title>
56 <Drawer.Description>{panel.description}</Drawer.Description>
57 </Drawer.Header>
58 <ul className="text-muted-foreground flex flex-col gap-2 text-sm">
59 {panel.items.map((item) => (
60 <li key={item} className="border-border bg-card rounded-md border px-3 py-2">
61 {item}
62 </li>
63 ))}
64 </ul>
65 <div className="mt-6 flex justify-end">
66 <Drawer.Close className="text-muted-foreground hover:text-foreground text-sm transition-colors">
67 {panel.action}
68 </Drawer.Close>
69 </div>
70 </Drawer.Content>
71 </Drawer>
72 ))}
73 </div>
74 );
75}