import React from 'react'; import { Table, Thead, Tbody, Tr, Th, Td, TableCaption, Switch, Text } from "@chakra-ui/react" import Head from 'next/head' import { useSession } from 'next-auth/client' import axios from 'axios' function Controller({initialState}) { const [online, setOnline] = React.useState(initialState) return ( { setOnline(!online) }} /> ) } function Commands() { const [session, loading] = useSession() const [categories, setCategories] = React.useState( [ {command: 'Help', online: true}, {command: 'Help', online: true}, {command: 'Help', online: true}, {command: 'Help', online: true}, ] ) React.useEffect(() => { axios.get('https://cath.night0721.repl.co/api/commands') .then(res => setCategories(res.data)) }, []) return ( <> {session && <> Cath Commands Command Controls {categories.map((category, idx) => ( <> {category.name} {category.commands.map((command, commandIdx)=> ( ))} ))}
Command Enabled
{command.name}
} {!session && <>

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

} ); } export default Commands