mirror of
https://github.com/Sea-Haven-Industries/shoc-frontend-new.git
synced 2026-10-05 23:32:06 +00:00
- api.ts: use ky v2 hook object args, prefix (not prefixUrl), and normalizeApiRequestError - replace react-router-dom with react-router in layout, topbar, and vendor-pos view - move MUI style props (justifyContent, alignItems, flexWrap, display, fontWeight) into sx - resource-list-table/query-key: use local types instead of missing work-order-list module
36 lines
1.1 KiB
TypeScript
36 lines
1.1 KiB
TypeScript
import { useState } from "react";
|
|
import { Outlet } from "react-router";
|
|
import { Box } from "@mui/material";
|
|
|
|
import { ProtectedRoute } from "@/components/auth/protected-route";
|
|
import { AppSidebar } from "@/components/layout/app-sidebar";
|
|
import { getSidebarWidth } from "@/config/menu";
|
|
import { AppTopbar } from "@/components/layout/app-topbar";
|
|
|
|
export default function AdminShellLayout() {
|
|
const [navCollapsed, setNavCollapsed] = useState(false);
|
|
const sidebarWidth = getSidebarWidth(navCollapsed);
|
|
|
|
return (
|
|
<ProtectedRoute>
|
|
<Box className="flex h-screen w-full overflow-hidden bg-background">
|
|
<AppSidebar collapsed={navCollapsed} />
|
|
|
|
<Box
|
|
className="flex h-screen min-w-0 flex-1 flex-col overflow-hidden"
|
|
sx={{ width: `calc(100% - ${sidebarWidth}px)` }}
|
|
>
|
|
<AppTopbar onToggleNav={() => setNavCollapsed((value) => !value)} />
|
|
|
|
<Box
|
|
component="main"
|
|
className="flex-1 overflow-auto"
|
|
sx={{ backgroundColor: "var(--color-bg-page)" }}
|
|
>
|
|
<Outlet />
|
|
</Box>
|
|
</Box>
|
|
</Box>
|
|
</ProtectedRoute>
|
|
);
|
|
}
|