nyx-dashboard/pages/controlpanel/commands.js

73 lines
2.7 KiB
JavaScript
Raw Normal View History

2021-06-20 15:49:56 +02:00
import React from 'react';
import { makeStyles } from '@material-ui/core/styles';
import Table from '@material-ui/core/Table';
import TableBody from '@material-ui/core/TableBody';
import TableCell from '@material-ui/core/TableCell';
import TableContainer from '@material-ui/core/TableContainer';
import TableHead from '@material-ui/core/TableHead';
import TableRow from '@material-ui/core/TableRow';
import Paper from '@material-ui/core/Paper';
2021-06-21 05:18:30 +02:00
import Head from 'next/head'
2021-06-22 02:19:52 +02:00
import { useSession } from 'next-auth/client'
2021-06-20 15:49:56 +02:00
const useStyles = makeStyles({
table: {
minWidth: 650,
},
});
function createData(name, description, status) {
return { name, description, status };
}
const rows = [
createData('Command', 'Description', true),
createData('Command', 'Description', true),
createData('Command', 'Description', true),
createData('Command', 'Description', true),
];
2021-06-20 16:01:27 +02:00
function Commands() {
2021-06-22 02:19:52 +02:00
const [session, loading] = useSession()
2021-06-20 15:49:56 +02:00
const classes = useStyles();
return (
2021-06-21 05:18:30 +02:00
<>
2021-06-22 02:19:52 +02:00
{session &&
<>
<Head>
<title>Cath Commands</title>
</Head>
<TableContainer component={Paper} style={{ background: '#1F1B24' }}>
<Table className={classes.table} aria-label="simple table">
<TableHead>
<TableRow>
<TableCell style={{ color: '#fff' }}>Commands</TableCell>
<TableCell align="right" style={{ color: '#fff' }}>Description</TableCell>
<TableCell align="right" style={{ color: '#fff' }}>Status</TableCell>
2021-06-21 05:18:30 +02:00
</TableRow>
2021-06-22 02:19:52 +02:00
</TableHead>
<TableBody>
{rows.map((row) => (
<TableRow key={row.name}>
<TableCell component="th" scope="row" style={{ color: '#fff' }}>
{row.name}
</TableCell>
<TableCell align="right" style={{ color: '#fff' }}>{row.description}</TableCell>
<TableCell align="right" style={{ color: '#fff' }}>{row.status ? 'Online' : 'Offline'}</TableCell>
</TableRow>
))}
</TableBody>
</Table>
</TableContainer>
</>
} {!session && <>
<h1>Seems like you&apos;re not logged in. Log in to get started!</h1>
</>
}
2021-06-21 05:18:30 +02:00
</>
2021-06-20 15:49:56 +02:00
);
}
2021-06-20 16:01:27 +02:00
export default Commands