-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCustomizeSidebarModal.tsx
More file actions
57 lines (55 loc) · 2.28 KB
/
Copy pathCustomizeSidebarModal.tsx
File metadata and controls
57 lines (55 loc) · 2.28 KB
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
import { Info, X, GripVertical, Eye, EyeOff } from "lucide-react";
import {
Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle,
} from "@/components/ui/dialog";
import { Button } from "@/components/ui/button";
import { TOOLS } from "./LeftRail";
interface Props {
open: boolean;
onOpenChange: (o: boolean) => void;
hiddenTools: Record<string, boolean>;
toggleVisible: (k: string) => void;
}
export const CustomizeSidebarModal = ({ open, onOpenChange, hiddenTools, toggleVisible }: Props) => (
<Dialog open={open} onOpenChange={onOpenChange}>
<DialogContent className="w-[420px] max-w-[calc(100vw-32px)] p-0">
<DialogHeader>
<div className="flex items-center gap-2.5">
<DialogTitle>Customize Sidebar</DialogTitle>
<Info className="h-3 w-3 text-text-faint" />
</div>
<Button variant="icon" size="icon" onClick={() => onOpenChange(false)}>
<X className="h-3.5 w-3.5" />
</Button>
</DialogHeader>
<DialogDescription>
Drag to reorder. Hide tools you rarely use to keep the rail focused.
</DialogDescription>
<div className="flex flex-col gap-1 overflow-y-auto px-4 py-3">
{TOOLS.map((t) => {
const hidden = !!hiddenTools[t.key];
return (
<div
key={t.key}
className="flex items-center gap-2.5 rounded-lg border border-hairline bg-chrome/30 px-2.5 py-2 hover:bg-p-200/[0.06]"
>
<span className="flex cursor-grab items-center text-text-faint">
<GripVertical className="h-3.5 w-3.5" />
</span>
<span className="flex items-center text-p-200">{t.icon}</span>
<span className="flex-1 text-[13px] text-text">{t.label}</span>
{t.exclusive && (
<span className="rounded-full bg-t-400/15 px-1.5 py-0.5 text-[9px] font-semibold tracking-[0.04em] text-t-400">
Laybel exclusive
</span>
)}
<Button variant="icon" size="icon" onClick={() => toggleVisible(t.key)}>
{hidden ? <EyeOff className="h-3.5 w-3.5" /> : <Eye className="h-3.5 w-3.5" />}
</Button>
</div>
);
})}
</div>
</DialogContent>
</Dialog>
);