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

Function SettingRouteShell

frontend/src/react/components/SettingRouteShell.tsx:12–34  ·  view source on GitHub ↗
({ onReady }: SettingRouteShellProps)

Source from the content-addressed store, hash-verified

10}
11
12export function SettingRouteShell({ onReady }: SettingRouteShellProps) {
13 const { t } = useTranslation();
14 const route = useCurrentRoute();
15 const contentRef = useRef<HTMLDivElement>(null);
16 const allowEdit = useWorkspacePermission("bb.settings.set");
17 const routeProps = useMemo(() => ({ allowEdit }), [allowEdit]);
18
19 useEffect(() => {
20 if (route.title) {
21 setDocumentTitle(route.title, t("common.settings"));
22 }
23 }, [route.title, t]);
24
25 useEffect(() => {
26 onReady?.({
27 content: contentRef.current,
28 routeProps,
29 });
30 return () => onReady?.(null);
31 }, [onReady, route.fullPath, routeProps]);
32
33 return <div ref={contentRef} className="min-h-full" />;
34}

Callers

nothing calls this directly

Calls 4

useCurrentRouteFunction · 0.90
useWorkspacePermissionFunction · 0.90
setDocumentTitleFunction · 0.90
tFunction · 0.50

Tested by

no test coverage detected