2020-08-15 10:17:15 +02:00
|
|
|
import { useRouter } from 'next/router';
|
2023-03-03 21:37:26 +01:00
|
|
|
import ShareLayout from 'components/layout/ShareLayout';
|
2023-01-10 08:59:26 +01:00
|
|
|
import WebsiteDetails from 'components/pages/websites/WebsiteDetails';
|
2020-10-11 11:29:55 +02:00
|
|
|
import useShareToken from 'hooks/useShareToken';
|
2020-08-15 10:17:15 +02:00
|
|
|
|
|
|
|
export default function SharePage() {
|
|
|
|
const router = useRouter();
|
|
|
|
const { id } = router.query;
|
2020-08-31 00:29:31 +02:00
|
|
|
const shareId = id?.[0];
|
2020-10-11 11:29:55 +02:00
|
|
|
const shareToken = useShareToken(shareId);
|
2020-08-15 10:17:15 +02:00
|
|
|
|
2020-10-11 11:29:55 +02:00
|
|
|
if (!shareToken) {
|
2020-08-31 00:29:31 +02:00
|
|
|
return null;
|
2020-08-15 10:17:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
2023-03-03 21:37:26 +01:00
|
|
|
<ShareLayout>
|
2022-12-13 20:27:55 +01:00
|
|
|
<WebsiteDetails websiteId={shareToken.websiteId} />
|
2023-03-03 21:37:26 +01:00
|
|
|
</ShareLayout>
|
2020-08-15 10:17:15 +02:00
|
|
|
);
|
|
|
|
}
|