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

Function Prefix

frontend/src/react/components/sql-editor/TabItem/Prefix.tsx:19–41  ·  view source on GitHub ↗
({ tab }: Props)

Source from the content-addressed store, hash-verified

17 * - Engine icon / unlink glyph via SheetConnectionIcon.
18 */
19export function Prefix({ tab }: Props) {
20 const { isWorksheetCreator } = useSheetContext();
21
22 const isDraft = !tab.worksheet && tab.viewState.view === "CODE";
23
24 const sheet = useAppStore((s) =>
25 tab.worksheet ? s.getWorksheetByName(tab.worksheet) : null
26 );
27
28 return (
29 <div className="opacity-80 flex items-center gap-x-2">
30 {isDraft ? (
31 <PencilLine className="size-4" />
32 ) : (
33 <>
34 {sheet && !isWorksheetCreator(sheet) && <Users className="size-4" />}
35 {tab.mode === "ADMIN" && <Wrench className="size-4" />}
36 </>
37 )}
38 <SheetConnectionIcon tab={tab} />
39 </div>
40 );
41}

Callers

nothing calls this directly

Calls 3

useSheetContextFunction · 0.90
isWorksheetCreatorFunction · 0.85
useAppStoreFunction · 0.50

Tested by

no test coverage detected