umami/pages/share/[...id].js
2023-07-10 00:33:30 -07:00

22 lines
550 B
JavaScript

import { useRouter } from 'next/router';
import ShareLayout from 'components/layout/ShareLayout';
import WebsiteDetailsPage from 'components/pages/websites/WebsiteDetailsPage';
import useShareToken from 'hooks/useShareToken';
export default function () {
const router = useRouter();
const { id } = router.query;
const shareId = id?.[0];
const shareToken = useShareToken(shareId);
if (!shareToken) {
return null;
}
return (
<ShareLayout>
<WebsiteDetailsPage websiteId={shareToken.websiteId} />
</ShareLayout>
);
}