import React from 'react'; import { Table, Thead, Tbody, Tr, Th, Td, TableCaption, Switch } from "@chakra-ui/react" import Head from 'next/head' import { useSession } from 'next-auth/client' function Controller({initialState}) { const [online, setOnline] = React.useState(initialState) React.useEffect(()=>{ // fake post req console.log(online) }, [online]) return ( { setOnline(!online) }} /> ) } function Commands() { const [session, loading] = useSession() const [commands, setCommands] = React.useState( [ {command: 'Help', online: true}, {command: 'Help', online: true}, {command: 'Help', online: true}, {command: 'Help', online: true}, ] ) return ( <> {session && <> Cath Commands Command Controls {commands.map((command, idx)=>( ))}
Command Enabled
{command.command}
} {!session && <>

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

} ); } export default Commands