From bb68cabf127a43d73b33af9d648726885b88de6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20Poduszl=C3=B3?= <14854048+kripod@users.noreply.github.com> Date: Fri, 15 Dec 2023 22:12:48 +0100 Subject: [PATCH] feat(Alert): warning sentiment --- src/components/Alert.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/Alert.tsx b/src/components/Alert.tsx index 76576fa..996aa03 100644 --- a/src/components/Alert.tsx +++ b/src/components/Alert.tsx @@ -1,17 +1,19 @@ import { ExclamationTriangleIcon, InformationCircleIcon, + XCircleIcon, } from "@heroicons/react/24/solid"; import { clsx } from "clsx"; export interface AlertProps { - sentiment?: "neutral" | "danger"; + sentiment?: "neutral" | "warning" | "danger"; children?: React.ReactNode; } const iconBySentiment = { neutral: InformationCircleIcon, - danger: ExclamationTriangleIcon, + warning: ExclamationTriangleIcon, + danger: XCircleIcon, } satisfies Record, React.ComponentType>; export function Alert({ sentiment = "neutral", children }: AlertProps) { @@ -23,6 +25,8 @@ export function Alert({ sentiment = "neutral", children }: AlertProps) { className={clsx("flex gap-x-2 rounded-2xl border p-4 text-base", { "border-ui-neutral-2 bg-ui-neutral-1 text-ui-neutral-5": sentiment === "neutral", + "border-ui-warning-2 bg-ui-warning-1 text-ui-warning-5": + sentiment === "warning", "border-ui-danger-2 bg-ui-danger-1 text-ui-danger-5": sentiment === "danger", })}