2021-11-16 22:52:23 +01:00
|
|
|
import React from "react";
|
|
|
|
import Card from "../../components/Card";
|
|
|
|
import Head from "next/head";
|
|
|
|
import { useSession } from "next-auth/client";
|
|
|
|
import { Flex, Text, Spacer } from "@chakra-ui/react";
|
|
|
|
import { motion } from "framer-motion";
|
2021-06-28 02:28:53 +02:00
|
|
|
|
2021-06-29 04:01:14 +02:00
|
|
|
const container = {
|
2021-11-16 22:52:23 +01:00
|
|
|
hidden: { opacity: 1, scale: 0 },
|
|
|
|
visible: {
|
|
|
|
opacity: 1,
|
|
|
|
scale: 1,
|
|
|
|
transition: {
|
|
|
|
delayChildren: 0.3,
|
|
|
|
staggerChildren: 0.2,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
2021-06-29 04:01:14 +02:00
|
|
|
|
|
|
|
const item = {
|
2021-11-16 22:52:23 +01:00
|
|
|
hidden: { y: 20, opacity: 0 },
|
|
|
|
visible: {
|
|
|
|
y: 0,
|
|
|
|
opacity: 1,
|
|
|
|
},
|
|
|
|
};
|
2021-06-20 15:49:56 +02:00
|
|
|
|
2021-06-22 02:24:07 +02:00
|
|
|
function Index() {
|
2021-11-16 22:52:23 +01:00
|
|
|
const [session, loading] = useSession();
|
2021-06-22 02:22:10 +02:00
|
|
|
|
2021-11-16 22:52:23 +01:00
|
|
|
return (
|
|
|
|
<>
|
|
|
|
{!session && (
|
|
|
|
<>
|
|
|
|
<h1>Seems like you're not logged in. Log in to get started!</h1>
|
|
|
|
</>
|
|
|
|
)}
|
|
|
|
{session && (
|
2021-06-29 04:01:14 +02:00
|
|
|
<>
|
2021-11-16 22:52:23 +01:00
|
|
|
<Head>
|
|
|
|
<title>Cath Control Panel</title>
|
|
|
|
</Head>
|
|
|
|
<Text fontSize="4xl" marginBottom="15">
|
|
|
|
Control Panel
|
|
|
|
</Text>
|
|
|
|
<motion.div
|
|
|
|
variants={container}
|
|
|
|
initial="hidden"
|
|
|
|
animate="visible"
|
|
|
|
exit={{ opacity: 0 }}
|
|
|
|
>
|
|
|
|
<Flex direction="column">
|
|
|
|
<Card
|
|
|
|
title="Commands"
|
|
|
|
desc="Control your commands"
|
|
|
|
link="/controlpanel/commands"
|
|
|
|
variants={item}
|
|
|
|
/>
|
|
|
|
<Spacer />
|
|
|
|
<Card
|
|
|
|
title="Commands"
|
|
|
|
desc="Control your commands"
|
|
|
|
link="/controlpanel/commands"
|
|
|
|
variants={item}
|
|
|
|
/>
|
|
|
|
<Spacer />
|
|
|
|
<Card
|
|
|
|
title="Commands"
|
|
|
|
desc="Control your commands"
|
|
|
|
link="/controlpanel/commands"
|
|
|
|
variants={item}
|
|
|
|
/>
|
|
|
|
</Flex>
|
|
|
|
</motion.div>
|
2021-06-21 05:18:30 +02:00
|
|
|
</>
|
2021-11-16 22:52:23 +01:00
|
|
|
)}
|
|
|
|
</>
|
|
|
|
);
|
2021-06-20 15:49:56 +02:00
|
|
|
}
|
|
|
|
|
2021-11-16 22:52:23 +01:00
|
|
|
export default Index;
|