fix(pages): stats being null

This commit is contained in:
diced 2021-06-23 12:18:10 -07:00
parent 166087e33c
commit ecef854d23
No known key found for this signature in database
GPG key ID: 85AB64C74535D76E

View file

@ -205,26 +205,29 @@ export default function Dashboard() {
onRowsPerPageChange={handleChangeRowsPerPage}
/>
</Card>
{stats && (
<>
<Card name='Images per User' sx={{ height: '100%', my: 2 }} elevation={0} variant='outlined'>
<StatTable
columns={[
{ id: 'username', name: 'Name' },
{ id: 'count', name: 'Images' }
]}
rows={stats.count_by_user}
/>
</Card>
<Card name='Images per User' sx={{ height: '100%', my: 2 }} elevation={0} variant='outlined'>
<StatTable
columns={[
{ id: 'username', name: 'Name' },
{ id: 'count', name: 'Images' }
]}
rows={stats.count_by_user}
/>
</Card>
<Card name='Types' sx={{ height: '100%', my: 2 }} elevation={0} variant='outlined'>
<StatTable
columns={[
{ id: 'mimetype', name: 'Type' },
{ id: 'count', name: 'Count' }
]}
rows={stats.types_count}
/>
</Card>
<Card name='Types' sx={{ height: '100%', my: 2 }} elevation={0} variant='outlined'>
<StatTable
columns={[
{ id: 'mimetype', name: 'Type' },
{ id: 'count', name: 'Count' }
]}
rows={stats.types_count}
/>
</Card>
</>
)}
</>
);
}