From c6908e902f34353d567ab5b325eea9462c73db3c Mon Sep 17 00:00:00 2001 From: RadoslavDimchev Date: Wed, 18 Oct 2023 09:43:17 +0300 Subject: [PATCH] feat: map alerts --- .../General/RightSideBar/AlertsList.tsx | 28 ++++++------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/src/components/General/RightSideBar/AlertsList.tsx b/src/components/General/RightSideBar/AlertsList.tsx index 4e11dd45..0b62c9d4 100644 --- a/src/components/General/RightSideBar/AlertsList.tsx +++ b/src/components/General/RightSideBar/AlertsList.tsx @@ -9,7 +9,7 @@ type Alert = { } const AlertsList = () => { - const [_, setAlerts] = useState([] as Alert[]) + const [alerts, setAlerts] = useState([] as Alert[]) useEffect(() => { setAlerts([ @@ -38,24 +38,14 @@ const AlertsList = () => { - } - variant="default" - onClosePress={() => alert('dismissed')} - /> - } - variant="information" - onClosePress={() => alert('dismissed')} - /> - } - variant="error" - onClosePress={() => alert('dismissed')} - /> + {alerts.map(alert => ( + } + variant={alert.variant} + /> + ))} ) }