umami/pages/console/[[...id]].js
Brian Cao 78338205a3
Feat/um 62 prisma property names (#1562)
* checkpoint

* fix pg schema

* fix mysql schema

* change property names
2022-10-10 13:42:18 -07:00

27 lines
603 B
JavaScript

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