This commit is contained in:
seb
2026-08-02 19:21:21 +02:00
parent b787549a85
commit 5309b1174b
6 changed files with 194 additions and 19 deletions

View File

@@ -19,7 +19,7 @@ function isSubNavActive(pathname, basePath, segment) {
return pathname === subPath || pathname === `${subPath}/`;
}
export default function PageLayout({ title, showTitle = true, subNav, basePath, children }) {
export default function PageLayout({ title, showTitle = true, titleAction, subNav, basePath, children }) {
const hasSubNav = subNav?.length > 0;
const navigate = useNavigate();
const { pathname } = useLocation();
@@ -81,9 +81,12 @@ export default function PageLayout({ title, showTitle = true, subNav, basePath,
<Box sx={{ flexGrow: 1, minWidth: 0 }}>
{showTitle ? (
<Typography variant="h5" sx={{ fontWeight: 700, mb: 2 }}>
{title}
</Typography>
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1.5, mb: 2 }}>
<Typography variant="h5" sx={{ fontWeight: 700 }}>
{title}
</Typography>
{titleAction}
</Box>
) : null}
{children}
</Box>