From 010420507564c2dfbb205af35f3f8c56692ab3ae Mon Sep 17 00:00:00 2001 From: Sat Naing Date: Fri, 9 Sep 2022 23:52:12 +0630 Subject: [PATCH] Update Card component props --- src/components/Card.astro | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/components/Card.astro b/src/components/Card.astro index a623797..1fb2c55 100644 --- a/src/components/Card.astro +++ b/src/components/Card.astro @@ -1,17 +1,19 @@ --- +import type { Frontmatter } from "src/pages/index.astro"; +import formatDatetime from "src/utils/formatDatetime"; + export interface Props { - title: string; - body: string; - href: string; + href?: string; + post: Frontmatter; secHeading?: boolean; } -const { href, title, body, secHeading = true } = Astro.props; +const { href, post, secHeading = true } = Astro.props; ---
  • - {secHeading ?

    {title}

    :

    {title}

    } + {secHeading ?

    {post.title}

    :

    {post.title}

    }
    - June 9, 2022 | 10:12 AM + {formatDatetime(post.datetime)}

    - {body} + {post.description}