diff --git a/pages/controlpanel/commands.js b/pages/controlpanel/commands.js index c160ac2..6ba3070 100644 --- a/pages/controlpanel/commands.js +++ b/pages/controlpanel/commands.js @@ -1,35 +1,50 @@ 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'; +import { + Table, + Thead, + Tbody, + Tr, + Th, + Td, + TableCaption, + Switch +} from "@chakra-ui/react" import Head from 'next/head' import { useSession } from 'next-auth/client' -const useStyles = makeStyles({ - table: { - minWidth: 650, - }, -}); -function createData(name, description, status) { - return { name, description, status }; +function Controller({initialState}) { + const [online, setOnline] = React.useState(initialState) + + React.useEffect(()=>{ + // fake post req + console.log(online) + }, [online]) + + return ( + { setOnline(!online) }} + /> + ) } -const rows = [ - createData('Command', 'Description', true), - createData('Command', 'Description', true), - createData('Command', 'Description', true), - createData('Command', 'Description', true), -]; - function Commands() { const [session, loading] = useSession() - const classes = useStyles(); + + + const [commands, setCommands] = React.useState( + [ + {command: 'Help', online: true}, + {command: 'Help', online: true}, + {command: 'Help', online: true}, + {command: 'Help', online: true}, + ] + ) + return ( <> @@ -38,28 +53,26 @@ function Commands() { Cath Commands - - - - - Commands - Description - Status - - - - {rows.map((row) => ( - - - {row.name} - - {row.description} - {row.status ? 'Online' : 'Offline'} - - ))} - -
-
+ + Command Controls + + + + + + + + {commands.map((command, idx)=>( + + + + + ))} + + +
CommandEnabled
{command.command} + +
} {!session && <>

Seems like you're not logged in. Log in to get started!