2023-02-13 12:41:30 +00:00
|
|
|
import { NextPage } from "next";
|
2023-05-25 07:03:57 +00:00
|
|
|
import { Typography, Box, Button, Grid, Link } from "@mui/material";
|
2023-05-25 09:34:43 +00:00
|
|
|
import { FC, useEffect, PropsWithChildren } from "react";
|
2023-02-13 12:41:30 +00:00
|
|
|
import { useRouter } from "next/router";
|
|
|
|
|
|
2023-05-25 09:34:43 +00:00
|
|
|
export const RedirectToAdmin: FC<PropsWithChildren> = ({ children }) => {
|
2023-02-13 12:41:30 +00:00
|
|
|
const router = useRouter();
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
router.push("/admin");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return <>{children}</>;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const Home: NextPage = () => (
|
|
|
|
|
<Box>
|
|
|
|
|
<Typography variant="h3">Metamigo</Typography>
|
2023-03-14 17:40:24 +00:00
|
|
|
<Grid container justifyContent="space-around" style={{ padding: 60 }}>
|
2023-02-13 12:41:30 +00:00
|
|
|
<Grid item>
|
|
|
|
|
<Link href="/admin">
|
|
|
|
|
<Button variant="contained">Admin</Button>
|
|
|
|
|
<RedirectToAdmin />
|
|
|
|
|
</Link>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Box>
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
export default Home;
|