diff --git a/src/app/(main)/[lang]/[slug]/[id]/page.tsx b/src/app/(main)/[lang]/[slug]/[id]/page.tsx deleted file mode 100644 index 4d8434130..000000000 --- a/src/app/(main)/[lang]/[slug]/[id]/page.tsx +++ /dev/null @@ -1,59 +0,0 @@ -import { loadQuery } from "@sanity/react-loader"; -import { Metadata } from "next"; - -import PostPage from "src/post/PostPage"; -import PostPagePreview from "src/post/PostPagePreview"; -import { getDraftModeInfo } from "src/utils/draftmode"; -import { fetchPostSeoData, generateMetadataFromSeo } from "src/utils/seo"; -import { BlogPage, Post } from "studio/lib/interfaces/pages"; -import { - BLOG_PAGE_QUERY, - MORE_POST_PREVIEW, - POST_SLUG_QUERY, - SEO_POST_SLUG_QUERY, -} from "studio/lib/queries/pages"; - -type Props = { - params: { - id: string; - slug: string; - }; -}; - -export async function generateMetadata({ params }: Props): Promise { - const seo = await fetchPostSeoData(SEO_POST_SLUG_QUERY, { id: params.id }); - return generateMetadataFromSeo(seo); -} - -const NestedSlugPage = async ({ params }: Props) => { - const { id, slug } = params; - const { perspective, isDraftMode } = getDraftModeInfo(); - - const [initialPost, initialBlogPage, initialPosts] = await Promise.all([ - loadQuery(POST_SLUG_QUERY, { id }, { perspective }), - loadQuery(BLOG_PAGE_QUERY, { slug }, { perspective }), - loadQuery(MORE_POST_PREVIEW, {}, { perspective }), - ]); - - if (isDraftMode) { - return ( - - ); - } - return ( - - ); -}; - -export default NestedSlugPage;