Create dashboard page
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import {redirect} from 'next/navigation'
|
||||
import {auth} from '../../auth.js'
|
||||
|
||||
export default async function DashboardPage() {
|
||||
const session = await auth()
|
||||
|
||||
if (!session) {
|
||||
redirect('/login')
|
||||
}
|
||||
|
||||
return (
|
||||
<div>DashboardPage</div>
|
||||
)
|
||||
}
|
||||
@@ -12,6 +12,7 @@ import Tooltip, {tooltipClasses} from '@mui/material/Tooltip'
|
||||
import LogoutIcon from '@mui/icons-material/Logout'
|
||||
import LoginIcon from '@mui/icons-material/Login'
|
||||
import PersonAddIcon from '@mui/icons-material/PersonAdd'
|
||||
import AdminPanelSettingsIcon from '@mui/icons-material/AdminPanelSettings'
|
||||
import ConfirmationAlert from './confirmation-alert.js'
|
||||
|
||||
const LightTooltip = styled(({className, ...props}) => (
|
||||
@@ -36,13 +37,20 @@ export default function Sign({session}) {
|
||||
|
||||
return (
|
||||
<>
|
||||
<Box sx={{display: 'flex', justifyContent: session ? 'start' : 'center', marginTop: 1}}>
|
||||
<Box sx={{display: 'flex', justifyContent: session ? 'start' : 'center', marginTop: 2}}>
|
||||
{session ? (
|
||||
<Stack direction='row' spacing={2}>
|
||||
<LightTooltip title='Se déconnecter' placement='right'>
|
||||
<Fab size='large' color='error' onClick={() => setIsOpen(true)}>
|
||||
<LogoutIcon fontSize='large' />
|
||||
</Fab>
|
||||
</LightTooltip>
|
||||
<LightTooltip title='Tableau de bord' placement='right'>
|
||||
<Fab sx={{mr: 3}} size='large' color='warning' onClick={() => router.push('/dashboard')}>
|
||||
<AdminPanelSettingsIcon fontSize='large' />
|
||||
</Fab>
|
||||
</LightTooltip>
|
||||
</Stack>
|
||||
) : (
|
||||
<Stack direction='row' spacing={2}>
|
||||
<LightTooltip title='Se connecter' placement='left'>
|
||||
|
||||
Reference in New Issue
Block a user