import { normalizeDate } from "@/lib/date"; import type { TPostListItem } from "@/types/docs.type"; import { nanoid } from "nanoid"; import Link from "next/link"; import { Badge } from "../ui/badge"; export const PostList = (props: { data: TPostListItem[] }) => { return (
{props.data.map((postItem, index) => (

{postItem.frontMatter.title}

{postItem.frontMatter.subtitle && (
{postItem.frontMatter.subtitle}
)}
{postItem.frontMatter.summary && (

{postItem.frontMatter.summary}

)}
{normalizeDate(postItem.frontMatter.time)}
{postItem.frontMatter.tags && (
{postItem.frontMatter.tags.map((tagName: string) => ( {tagName} ))}
)}
))}
); };