import Link from "next/link"; import { Suspense } from "react"; import Avatar from "./avatar"; import CoverImage from "./cover-image"; import DateComponent from "./date"; import MoreStories from "./more-stories"; import Onboarding from "./onboarding"; import PortableText from "./portable-text"; import type { HeroQueryResult } from "@/sanity.types"; import * as demo from "@/sanity/lib/demo"; import { sanityFetch } from "@/sanity/lib/fetch"; import { heroQuery, settingsQuery } from "@/sanity/lib/queries"; function Intro(props: { title: string | null | undefined; description: any }) { const title = props.title || demo.title; const description = props.description?.length ? props.description : demo.description; return (

{title || demo.title}

); } function HeroPost({ title, slug, excerpt, coverImage, date, author, }: Pick< Exclude, "title" | "coverImage" | "date" | "excerpt" | "author" | "slug" >) { return (

{title}

{excerpt && (

{excerpt}

)} {author && }
); } export default async function Page() { const [settings, heroPost] = await Promise.all([ sanityFetch({ query: settingsQuery, }), sanityFetch({ query: heroQuery }), ]); return (
{heroPost ? ( ) : ( )} {heroPost?._id && ( )}
); }