feat(admin): add MUI AdminLayout and persist auth; wrap EditorShell with layout and logout
This commit is contained in:
parent
a0fd0e0b3c
commit
43e6d4b53c
@ -1,9 +1,15 @@
|
|||||||
import { Typography } from '@mui/material';
|
import { Typography } from '@mui/material';
|
||||||
|
import AdminLayout from '../layout/AdminLayout';
|
||||||
|
|
||||||
export default function EditorShell() {
|
export default function EditorShell({ onLogout }: { onLogout?: () => void }) {
|
||||||
return (
|
return (
|
||||||
<Typography variant="h4" sx={{ p: 3 }}>
|
<AdminLayout title="VoxBlog Admin" onLogout={onLogout}>
|
||||||
Welcome to VoxBlog Editor
|
<Typography variant="h4" sx={{ mb: 2 }}>
|
||||||
</Typography>
|
Welcome to VoxBlog Editor
|
||||||
|
</Typography>
|
||||||
|
<Typography variant="body1">
|
||||||
|
Coming next: audio recorder, rich editor, AI tools, and Ghost publish flow.
|
||||||
|
</Typography>
|
||||||
|
</AdminLayout>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
22
apps/admin/src/layout/AdminLayout.tsx
Normal file
22
apps/admin/src/layout/AdminLayout.tsx
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
import { AppBar, Box, Button, Container, Toolbar, Typography } from '@mui/material';
|
||||||
|
import type { ReactNode } from 'react';
|
||||||
|
|
||||||
|
export default function AdminLayout({ title, onLogout, children }: { title?: string; onLogout?: () => void; children: ReactNode }) {
|
||||||
|
return (
|
||||||
|
<Box sx={{ display: 'flex', flexDirection: 'column', minHeight: '100vh' }}>
|
||||||
|
<AppBar position="static">
|
||||||
|
<Toolbar>
|
||||||
|
<Typography variant="h6" sx={{ flexGrow: 1 }}>
|
||||||
|
{title || 'VoxBlog Admin'}
|
||||||
|
</Typography>
|
||||||
|
{onLogout && (
|
||||||
|
<Button color="inherit" onClick={onLogout}>Logout</Button>
|
||||||
|
)}
|
||||||
|
</Toolbar>
|
||||||
|
</AppBar>
|
||||||
|
<Container maxWidth="lg" sx={{ py: 3, flex: 1 }}>
|
||||||
|
{children}
|
||||||
|
</Container>
|
||||||
|
</Box>
|
||||||
|
);
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user