From f78d956bfd42134b51de2d9365967f154718fa82 Mon Sep 17 00:00:00 2001 From: Sat Naing Date: Sun, 11 Sep 2022 03:04:07 +0630 Subject: [PATCH] Create Tag component --- src/components/Tag.astro | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/components/Tag.astro diff --git a/src/components/Tag.astro b/src/components/Tag.astro new file mode 100644 index 0000000..cdf8d4c --- /dev/null +++ b/src/components/Tag.astro @@ -0,0 +1,39 @@ +--- +export interface Props { + name: string; + size?: "sm" | "lg"; +} + +const { name, size = "sm" } = Astro.props; + +const slug = ((str: string) => + str + .toLowerCase() + .replace(/ /g, "-") + .replace(/[^\w-]+/g, ""))(name); +--- + +
  • + + + + {name} + +
  • + +