MCPcopy Create free account
hub / github.com/triggerdotdev/jsonhero-web / SideBar

Function SideBar

app/components/SideBar.tsx:11–66  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9import { useTheme } from "./ThemeProvider";
10
11export function SideBar() {
12 const { doc } = useJsonDoc();
13
14 return (
15 <div className="side-bar flex flex-col align-center justify-between h-full p-1 bg-slate-200 transition dark:bg-slate-800">
16 <ol className="relative">
17 <SidebarLink to={`/j/${doc.id}`} hotKey="option+1,alt+1">
18 <ToolTip arrow="left">
19 <Body>Column view</Body>
20 <ShortcutIcon className="w-[26px] h-[26px] ml-1 text-slate-700 bg-slate-200 dark:text-slate-300 dark:bg-slate-800">
21
22 </ShortcutIcon>
23 <ShortcutIcon className="w-[26px] h-[26px] ml-1 text-slate-700 bg-slate-200 dark:text-slate-300 dark:bg-slate-800">
24 1
25 </ShortcutIcon>
26 </ToolTip>
27 <TemplateIcon className="p-2 w-full h-full" />
28 </SidebarLink>
29 <SidebarLink to={`/j/${doc.id}/editor`} hotKey="option+2,alt+2">
30 <ToolTip arrow="left">
31 <Body>JSON view</Body>
32 <ShortcutIcon className="w-[26px] h-[26px] ml-1 text-slate-700 bg-slate-200 dark:text-slate-300 dark:bg-slate-800">
33
34 </ShortcutIcon>
35 <ShortcutIcon className="w-[26px] h-[26px] ml-1 text-slate-700 bg-slate-200 dark:text-slate-300 dark:bg-slate-800">
36 2
37 </ShortcutIcon>
38 </ToolTip>
39 <CodeIcon className="p-2 w-full h-full" />
40 </SidebarLink>
41 <SidebarLink to={`/j/${doc.id}/tree`} hotKey="option+3,alt+3">
42 <ToolTip arrow="left">
43 <Body>Tree view</Body>
44 <ShortcutIcon className="w-[26px] h-[26px] ml-1 text-slate-700 bg-slate-200 dark:text-slate-300 dark:bg-slate-800">
45
46 </ShortcutIcon>
47 <ShortcutIcon className="w-[26px] h-[26px] ml-1 text-slate-700 bg-slate-200 dark:text-slate-300 dark:bg-slate-800">
48 3
49 </ShortcutIcon>
50 </ToolTip>
51 <TreeIcon className="p-2 w-full h-full" />
52 </SidebarLink>
53 </ol>
54 <ol>
55 <SidebarLink>
56 <a href={`/j/${doc.id}.json`} target="_blank">
57 <ToolTip arrow="left">
58 <Body>Download</Body>
59 </ToolTip>
60 <DownloadIcon className="p-2 w-full h-full" />
61 </a>
62 </SidebarLink>
63 </ol>
64 </div>
65 );
66}
67
68function SidebarLink({

Callers

nothing calls this directly

Calls 1

useJsonDocFunction · 0.90

Tested by

no test coverage detected