From d815b5b9b2e997bb1c1b9482a617a76c1658ffee Mon Sep 17 00:00:00 2001 From: satnaing Date: Sat, 28 Jan 2023 00:25:36 +0630 Subject: [PATCH] revert: revert back to JSX Card component --- src/components/Card.astro | 40 --------------------------------------- src/components/Card.tsx | 32 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 40 deletions(-) delete mode 100644 src/components/Card.astro create mode 100644 src/components/Card.tsx diff --git a/src/components/Card.astro b/src/components/Card.astro deleted file mode 100644 index e41b36c..0000000 --- a/src/components/Card.astro +++ /dev/null @@ -1,40 +0,0 @@ ---- -import Datetime from "./Datetime"; -import type { BlogFrontmatter } from "@content/schemas"; - -export interface Props { - href?: string; - frontmatter: BlogFrontmatter; - secHeading?: boolean; -} - -const { href, frontmatter, secHeading } = Astro.props; - -const { title, publishDatetime, description } = frontmatter; ---- - -
  • - - { - secHeading ? ( -

    {title}

    - ) : ( -

    {title}

    - ) - } -
    - -

    {description}

    -
  • - - diff --git a/src/components/Card.tsx b/src/components/Card.tsx new file mode 100644 index 0000000..bb2d733 --- /dev/null +++ b/src/components/Card.tsx @@ -0,0 +1,32 @@ +import Datetime from "./Datetime"; +import type { BlogFrontmatter } from "@content/_schemas"; + +export interface Props { + href?: string; + frontmatter: BlogFrontmatter; + secHeading?: boolean; +} + +export default function Card({ href, frontmatter, secHeading = true }: Props) { + const { title, pubDatetime, description } = frontmatter; + return ( +
  • + + {secHeading ? ( +

    + {title} +

    + ) : ( +

    + {title} +

    + )} +
    + +

    {description}

    +
  • + ); +}