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;