umami/pages/console/[[...id]].js
2023-01-04 21:20:24 -08:00

26 lines
527 B
JavaScript

import Layout from 'components/layout/Layout';
import TestConsole from 'components/pages/TestConsole';
import useRequireLogin from 'hooks/useRequireLogin';
export default function ConsolePage({ pageDisabled }) {
const { user } = useRequireLogin();
if (pageDisabled || !user || !user.isAdmin) {
return null;
}
return (
<Layout>
<TestConsole />
</Layout>
);
}
export async function getServerSideProps() {
return {
props: {
pageDisabled: !process.env.ENABLE_TEST_CONSOLE,
},
};
}