MCPcopy Create free account
hub / github.com/bytebase/bytebase / GutterBar

Function GutterBar

frontend/src/react/components/sql-editor/GutterBar.tsx:22–63  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

20 * Replaces frontend/src/views/sql-editor/AsidePanel/GutterBar/GutterBar.vue.
21 */
22export function GutterBar() {
23 const setAsidePanelTab = useSQLEditorStore((s) => s.setAsidePanelTab);
24 const projectName = useSQLEditorEditorState((s) => s.project);
25
26 const resolvedProject = useAppProject(projectName);
27 const project = projectName ? resolvedProject : undefined;
28
29 const routeProjectParam = useReactiveRoute().params.project as
30 | string
31 | undefined;
32
33 const logoRoute = routeProjectParam
34 ? {
35 name: PROJECT_V1_ROUTE_DETAIL,
36 params: { projectId: routeProjectParam },
37 }
38 : { name: WORKSPACE_ROUTE_LANDING };
39
40 const handleClickTab = (target: AsidePanelTab) => {
41 setAsidePanelTab(target);
42 };
43
44 return (
45 <div className="h-full flex flex-col items-stretch justify-between overflow-hidden text-sm p-1">
46 <div className="flex flex-col gap-y-1">
47 <div className="flex flex-col justify-center items-center pb-1">
48 <RouterLink to={logoRoute} target="_blank" rel="noopener noreferrer">
49 <img className="w-9 h-auto" src={logoIcon} alt="Bytebase" />
50 </RouterLink>
51 </div>
52 <Separator />
53 <TabItem tab="WORKSHEET" onClick={() => handleClickTab("WORKSHEET")} />
54 <TabItem tab="SCHEMA" onClick={() => handleClickTab("SCHEMA")} />
55 <TabItem tab="HISTORY" onClick={() => handleClickTab("HISTORY")} />
56 {project?.allowJustInTimeAccess && (
57 <TabItem tab="ACCESS" onClick={() => handleClickTab("ACCESS")} />
58 )}
59 </div>
60 <div className="flex flex-col justify-end items-center" />
61 </div>
62 );
63}

Callers

nothing calls this directly

Calls 4

useSQLEditorEditorStateFunction · 0.90
useAppProjectFunction · 0.90
useReactiveRouteFunction · 0.90
handleClickTabFunction · 0.85

Tested by

no test coverage detected