feat: map alerts

This commit is contained in:
RadoslavDimchev 2023-10-18 09:43:17 +03:00
parent b8e43a986b
commit c6908e902f

View File

@ -9,7 +9,7 @@ type Alert = {
} }
const AlertsList = () => { const AlertsList = () => {
const [_, setAlerts] = useState([] as Alert[]) const [alerts, setAlerts] = useState([] as Alert[])
useEffect(() => { useEffect(() => {
setAlerts([ setAlerts([
@ -38,24 +38,14 @@ const AlertsList = () => {
<ChevronRightIcon size={20} /> <ChevronRightIcon size={20} />
</div> </div>
</XStack> </XStack>
<InformationBox {alerts.map(alert => (
message="Network: Participation rate below 66%" <InformationBox
icon={<CloseCircleIcon size={20} />} key={alert.message}
variant="default" message={alert.message}
onClosePress={() => alert('dismissed')} icon={<CloseCircleIcon size={20} />}
/> variant={alert.variant}
<InformationBox />
message="Node: 32 Peers Connected" ))}
icon={<CloseCircleIcon size={20} />}
variant="information"
onClosePress={() => alert('dismissed')}
/>
<InformationBox
message="Node / Validator: Process Down"
icon={<CloseCircleIcon size={20} />}
variant="error"
onClosePress={() => alert('dismissed')}
/>
</YStack> </YStack>
) )
} }