routes
This commit is contained in:
@@ -1,20 +0,0 @@
|
||||
import { Outlet, useLocation } from 'react-router-dom';
|
||||
import PageLayout from '../components/PageLayout';
|
||||
import { NAV_ITEMS, SUB_NAV } from '../nav';
|
||||
|
||||
export default function SectionPage({ sectionPath, children }) {
|
||||
const { pathname } = useLocation();
|
||||
const title = NAV_ITEMS.find((item) => item.path === sectionPath)?.label ?? '';
|
||||
const subNav = SUB_NAV[sectionPath];
|
||||
const activeSub = subNav?.find((item) => {
|
||||
const subPath = item.segment ? `${sectionPath}/${item.segment}` : sectionPath;
|
||||
return pathname === subPath || pathname === `${subPath}/`;
|
||||
});
|
||||
const pageTitle = activeSub && subNav ? activeSub.label : title;
|
||||
|
||||
return (
|
||||
<PageLayout title={pageTitle} subNav={subNav} basePath={sectionPath}>
|
||||
{children ?? <Outlet />}
|
||||
</PageLayout>
|
||||
);
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
import Typography from '@mui/material/Typography';
|
||||
|
||||
export default function SubPage({ title, description }) {
|
||||
return (
|
||||
<Typography color="text.secondary">
|
||||
{description ?? `${title} — Inhalt folgt.`}
|
||||
</Typography>
|
||||
);
|
||||
}
|
||||
7
src/pages/artikel/index.jsx
Normal file
7
src/pages/artikel/index.jsx
Normal file
@@ -0,0 +1,7 @@
|
||||
import Typography from '@mui/material/Typography';
|
||||
|
||||
export default function ArtikelUebersichtPage() {
|
||||
return (
|
||||
<Typography color="text.secondary">Übersicht — Inhalt folgt.</Typography>
|
||||
);
|
||||
}
|
||||
7
src/pages/artikel/kategorien.jsx
Normal file
7
src/pages/artikel/kategorien.jsx
Normal file
@@ -0,0 +1,7 @@
|
||||
import Typography from '@mui/material/Typography';
|
||||
|
||||
export default function ArtikelKategorienPage() {
|
||||
return (
|
||||
<Typography color="text.secondary">Kategorien — Inhalt folgt.</Typography>
|
||||
);
|
||||
}
|
||||
7
src/pages/artikel/lager.jsx
Normal file
7
src/pages/artikel/lager.jsx
Normal file
@@ -0,0 +1,7 @@
|
||||
import Typography from '@mui/material/Typography';
|
||||
|
||||
export default function ArtikelLagerPage() {
|
||||
return (
|
||||
<Typography color="text.secondary">Lager — Inhalt folgt.</Typography>
|
||||
);
|
||||
}
|
||||
7
src/pages/auftrag/archiv.jsx
Normal file
7
src/pages/auftrag/archiv.jsx
Normal file
@@ -0,0 +1,7 @@
|
||||
import Typography from '@mui/material/Typography';
|
||||
|
||||
export default function AuftragArchivPage() {
|
||||
return (
|
||||
<Typography color="text.secondary">Archiv — Inhalt folgt.</Typography>
|
||||
);
|
||||
}
|
||||
7
src/pages/auftrag/index.jsx
Normal file
7
src/pages/auftrag/index.jsx
Normal file
@@ -0,0 +1,7 @@
|
||||
import Typography from '@mui/material/Typography';
|
||||
|
||||
export default function AuftragAktivePage() {
|
||||
return (
|
||||
<Typography color="text.secondary">Aktive Aufträge — Inhalt folgt.</Typography>
|
||||
);
|
||||
}
|
||||
10
src/pages/index.jsx
Normal file
10
src/pages/index.jsx
Normal file
@@ -0,0 +1,10 @@
|
||||
import Typography from '@mui/material/Typography';
|
||||
import PageLayout from '../components/PageLayout';
|
||||
|
||||
export default function HomePage() {
|
||||
return (
|
||||
<PageLayout title="Home">
|
||||
<Typography color="text.secondary">Home — Inhalt folgt.</Typography>
|
||||
</PageLayout>
|
||||
);
|
||||
}
|
||||
10
src/pages/infos/index.jsx
Normal file
10
src/pages/infos/index.jsx
Normal file
@@ -0,0 +1,10 @@
|
||||
import Typography from '@mui/material/Typography';
|
||||
import PageLayout from '../../components/PageLayout';
|
||||
|
||||
export default function InfosPage() {
|
||||
return (
|
||||
<PageLayout title="Infos">
|
||||
<Typography color="text.secondary">Infos — Inhalt folgt.</Typography>
|
||||
</PageLayout>
|
||||
);
|
||||
}
|
||||
7
src/pages/kunde/gruppen.jsx
Normal file
7
src/pages/kunde/gruppen.jsx
Normal file
@@ -0,0 +1,7 @@
|
||||
import Typography from '@mui/material/Typography';
|
||||
|
||||
export default function KundeGruppenPage() {
|
||||
return (
|
||||
<Typography color="text.secondary">Gruppen — Inhalt folgt.</Typography>
|
||||
);
|
||||
}
|
||||
7
src/pages/kunde/index.jsx
Normal file
7
src/pages/kunde/index.jsx
Normal file
@@ -0,0 +1,7 @@
|
||||
import Typography from '@mui/material/Typography';
|
||||
|
||||
export default function KundeListePage() {
|
||||
return (
|
||||
<Typography color="text.secondary">Kundenliste — Inhalt folgt.</Typography>
|
||||
);
|
||||
}
|
||||
7
src/pages/kunde/kontakte.jsx
Normal file
7
src/pages/kunde/kontakte.jsx
Normal file
@@ -0,0 +1,7 @@
|
||||
import Typography from '@mui/material/Typography';
|
||||
|
||||
export default function KundeKontaktePage() {
|
||||
return (
|
||||
<Typography color="text.secondary">Kontakte — Inhalt folgt.</Typography>
|
||||
);
|
||||
}
|
||||
10
src/pages/lieferung/index.jsx
Normal file
10
src/pages/lieferung/index.jsx
Normal file
@@ -0,0 +1,10 @@
|
||||
import Typography from '@mui/material/Typography';
|
||||
import PageLayout from '../../components/PageLayout';
|
||||
|
||||
export default function LieferungPage() {
|
||||
return (
|
||||
<PageLayout title="Lieferung">
|
||||
<Typography color="text.secondary">Lieferung — Inhalt folgt.</Typography>
|
||||
</PageLayout>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user