From d10fefa83a8145cd751d01c2fed8f641b14e0ee4 Mon Sep 17 00:00:00 2001 From: Manuel Date: Fri, 31 May 2024 10:00:11 +0200 Subject: [PATCH] feat: extend alert interface with div props --- src/components/alert/alert.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/alert/alert.tsx b/src/components/alert/alert.tsx index 9ea6a8d1..5dffc56a 100644 --- a/src/components/alert/alert.tsx +++ b/src/components/alert/alert.tsx @@ -25,13 +25,13 @@ const iconNames: Record = { danger: ErrorIcon, }; -export interface AlertProps { +export interface AlertProps extends React.ComponentPropsWithoutRef<"div"> { title: string; intent: AlertIntent; children?: React.ReactNode; } -export const Alert = ({ title, children, intent }: AlertProps) => { +export const Alert = ({ title, children, intent, ...props }: AlertProps) => { const Icon = iconNames[intent]; return ( @@ -41,6 +41,7 @@ export const Alert = ({ title, children, intent }: AlertProps) => { "flex flex-row gap-4 rounded-lg border px-4 py-3 text-neutral-800", alertVariants[intent] )} + {...props} >