nyx-dashboard/pages/index.js

51 lines
1.7 KiB
JavaScript
Raw Normal View History

2021-06-20 13:39:00 +02:00
import { Typography } from '@material-ui/core'
import CardContainer from '../components/CardContainer'
import { useSession } from 'next-auth/client'
2021-06-20 13:39:00 +02:00
export default function Home() {
const [session, loading] = useSession()
2021-06-20 13:39:00 +02:00
return (
<>
{!session && <>
<h1>Seems like you're not logged in. Log in to get started!</h1>
</>
}
{session && <>
<h1>Welcome {session.user.name}!</h1>
2021-06-20 13:39:00 +02:00
<div className='grid'>
2021-06-20 15:49:56 +02:00
<CardContainer title='Commands' link='/controlpanel/commands'>Command controls</CardContainer>
<CardContainer title='Commands' link='/controlpanel/commands'>Command controls</CardContainer>
<CardContainer title='Commands' link='/controlpanel/commands'>Command controls</CardContainer>
<CardContainer title='Commands' link='/controlpanel/commands'>Command controls</CardContainer>
<CardContainer title='Commands' link='/controlpanel/commands'>Command controls</CardContainer>
2021-06-20 13:39:00 +02:00
</div>
</>
}
</>
2021-06-20 13:39:00 +02:00
)
if (!session) {
return (
<>
<h1>Welcome User!</h1>
<div className='grid'>
<CardContainer title='Commands' link='/controlpanel/commands'>Command controls</CardContainer>
<CardContainer title='Commands' link='/controlpanel/commands'>Command controls</CardContainer>
<CardContainer title='Commands' link='/controlpanel/commands'>Command controls</CardContainer>
<CardContainer title='Commands' link='/controlpanel/commands'>Command controls</CardContainer>
<CardContainer title='Commands' link='/controlpanel/commands'>Command controls</CardContainer>
</div>
</>
)
} else {
return (
<>
<h1>Seems like you're not logged in. Log in to get started!</h1>
</>
)
}
2021-06-20 13:39:00 +02:00
}