45 lines
1.1 KiB
TypeScript
45 lines
1.1 KiB
TypeScript
'use client';
|
|
|
|
import { ActionIcon, Box, Burger, Group, Title } from '@mantine/core';
|
|
import { useAdmin } from './admin-provider';
|
|
import { UserMenu } from '../auth/user-menu';
|
|
|
|
export function AdminHeader() {
|
|
const { toggleMobile, mobileOpened } = useAdmin();
|
|
|
|
return (
|
|
<Box
|
|
component="header"
|
|
style={{
|
|
padding: '1rem',
|
|
borderBottom: '1px solid var(--mantine-color-gray-3)',
|
|
backgroundColor: 'white',
|
|
position: 'sticky',
|
|
top: 0,
|
|
zIndex: 100,
|
|
}}
|
|
>
|
|
<Group justify="space-between" align="center">
|
|
<Group>
|
|
<ActionIcon
|
|
variant="subtle"
|
|
onClick={toggleMobile}
|
|
aria-label="Toggle sidebar"
|
|
visibleFrom="sm"
|
|
style={{ display: mobileOpened ? 'none' : 'block' }}
|
|
>
|
|
<Burger opened={mobileOpened} size="sm" />
|
|
</ActionIcon>
|
|
<Title order={4} fw={500}>
|
|
Dashboard Admin
|
|
</Title>
|
|
</Group>
|
|
|
|
<Group>
|
|
<UserMenu />
|
|
</Group>
|
|
</Group>
|
|
</Box>
|
|
);
|
|
}
|