57 lines
1.3 KiB
JavaScript
57 lines
1.3 KiB
JavaScript
import { makeGetServerSideProps } from '.';
|
|
import AdminTable from '@/Components/Admin/AdminTable/AdminTable';
|
|
import { Error } from '@/Components/Common/Error';
|
|
import Background from '@/Components/Layout/Background';
|
|
import { Grid } from '@/Components/Layout/Page';
|
|
import { unlimitedRoles } from '@/config/users';
|
|
import * as hooks from '@/process/hooks';
|
|
import { useStore } from '@/stores/hooks';
|
|
import { min } from '@/styles/mq';
|
|
import Head from 'next/head';
|
|
import styled from 'styled-components';
|
|
|
|
function Content() {
|
|
const store = useStore();
|
|
store.$process.add('Unlimited');
|
|
|
|
hooks.useSentryScope();
|
|
hooks.useMainData();
|
|
hooks.useGetUsers();
|
|
hooks.useInsuranceData();
|
|
hooks.useReactions();
|
|
|
|
const Wrapper = styled(Background)`
|
|
padding: 4px 6px;
|
|
|
|
${min('tablet')} {
|
|
min-height: 790px;
|
|
}
|
|
|
|
${min('laptop')} {
|
|
padding: 4px 6px 10px;
|
|
}
|
|
`;
|
|
|
|
return (
|
|
<Grid>
|
|
<Head>
|
|
<title>Админка</title>
|
|
<meta name="description" content="Админка" />
|
|
</Head>
|
|
<Wrapper>
|
|
<AdminTable />
|
|
</Wrapper>
|
|
</Grid>
|
|
);
|
|
}
|
|
|
|
export default function Admin(props) {
|
|
if (props.statusCode !== 200) return <Error {...props} />;
|
|
|
|
return <Content />;
|
|
}
|
|
|
|
export const getServerSideProps = makeGetServerSideProps({
|
|
roles: unlimitedRoles,
|
|
});
|