({ onReady }: SettingRouteShellProps)
| 10 | } |
| 11 | |
| 12 | export 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 | } |
nothing calls this directly
no test coverage detected