--- import { type CollectionEntry, render } from "astro:content"; import FormattedDate from "@/components/FormattedDate.astro"; import type { HTMLTag, Polymorphic } from "astro/types"; type Props = Polymorphic<{ as: Tag }> & { note: CollectionEntry<"note">; isPreview?: boolean | undefined; }; const { as: Tag = "div", note, isPreview = false } = Astro.props; const { Content } = await render(note); const dateTimeOptions: Intl.DateTimeFormatOptions = note.data.date_created ? { hour: "2-digit", minute: "2-digit", year: "2-digit", month: "2-digit", day: "2-digit", } : { year: "2-digit", month: "2-digit", day: "2-digit", }; const date = note.data.date_created ?? note.data.date; ---
{ isPreview ? ( {note.data.title} ) : ( <>{note.data.title} ) }