mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-16 02:05:04 +01:00
28 lines
628 B
JavaScript
28 lines
628 B
JavaScript
import { useRouter } from 'next/router';
|
|
import Layout from 'components/layout/Layout';
|
|
import Dashboard from 'components/pages/Dashboard';
|
|
import useConfig from 'hooks/useConfig';
|
|
import useRequireLogin from 'hooks/useRequireLogin';
|
|
|
|
export default function DashboardPage() {
|
|
const {
|
|
query: { id },
|
|
isReady,
|
|
asPath,
|
|
} = useRouter();
|
|
const { user } = useRequireLogin();
|
|
const { adminDisabled } = useConfig();
|
|
|
|
if (adminDisabled || !user || !isReady) {
|
|
return null;
|
|
}
|
|
|
|
const userId = id?.[0];
|
|
|
|
return (
|
|
<Layout>
|
|
<Dashboard key={asPath} userId={user.id || userId} />
|
|
</Layout>
|
|
);
|
|
}
|