From f905a54d8264675d45491e5d2b1940f7a5435eea Mon Sep 17 00:00:00 2001 From: Vadym Pavlyk Date: Wed, 27 Nov 2024 12:18:24 +0200 Subject: [PATCH] Extract icon mapping into a variable outside the component --- src/design-system/components/alert/Alert.tsx | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/design-system/components/alert/Alert.tsx b/src/design-system/components/alert/Alert.tsx index 8f046dc06..03ccd53b5 100644 --- a/src/design-system/components/alert/Alert.tsx +++ b/src/design-system/components/alert/Alert.tsx @@ -36,6 +36,15 @@ const CloseButton = ({ label }: CloseButtonProps) => { ) } +CloseButton.displayName = 'CloseButton' + +const iconMapping = { + error: , + warning: , + info: , + success: +} + interface AlertProps extends MuiAlertProps { title?: string description?: string @@ -68,12 +77,7 @@ const Alert = forwardRef( , - warning: , - info: , - success: - }} + iconMapping={iconMapping} onClose={handleClose} ref={forwardedRef} slots={{