From 84d418cb01956e8c10303708fec85c69509bd55f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Voisin?= Date: Sun, 17 Aug 2025 22:55:31 +0200 Subject: [PATCH] feat: warning icon & callout --- src/assets/icons/warning.svg | 9 +++++++++ src/components/Callout.astro | 28 +++++++++++++++++++++++----- 2 files changed, 32 insertions(+), 5 deletions(-) create mode 100644 src/assets/icons/warning.svg diff --git a/src/assets/icons/warning.svg b/src/assets/icons/warning.svg new file mode 100644 index 0000000..905f5a2 --- /dev/null +++ b/src/assets/icons/warning.svg @@ -0,0 +1,9 @@ + + + + + \ No newline at end of file diff --git a/src/components/Callout.astro b/src/components/Callout.astro index 1eba5c1..d4891da 100644 --- a/src/components/Callout.astro +++ b/src/components/Callout.astro @@ -1,16 +1,28 @@ --- import Information from "@assets/icons/information.svg"; +import Warning from "@assets/icons/warning.svg"; type Props = { title?: string; - variant?: "note"; + variant?: "note" | "warning"; }; const { title, variant = "note" } = Astro.props; + +let Icon: (_props: astroHTML.JSX.SVGAttributes) => any; + +switch (variant) { + case "note": + Icon = Information; + break; + case "warning": + Icon = Warning; + break; +} ---
- {variant === "note" ? : ""} +
{title &&

{title}

} @@ -21,6 +33,15 @@ const { title, variant = "note" } = Astro.props; -- 2.51.2