Files
Ghom 291dcf9515 Merge pull request #10575 from Arturlang/TGUIs_Nexties
[TESTMERGE] Properly working TGUI Next
2021-01-04 19:47:54 -03:00

45 lines
1.2 KiB
JavaScript

import { useBackend } from '../backend';
import { Button, Section } from '../components';
export const AtmosAlertConsole = props => {
const { act, data } = useBackend(props);
const priorityAlerts = data.priority || [];
const minorAlerts = data.minor || [];
return (
<Section title="Alarms">
<ul>
{priorityAlerts.length > 0 ? (
priorityAlerts.map(alert => (
<li key={alert}>
<Button
icon="times"
content={alert}
color="bad"
onClick={() => act('clear', { zone: alert })} />
</li>
))
) : (
<li className="color-good">
No Priority Alerts
</li>
)}
{minorAlerts.length > 0 ? (
minorAlerts.map(alert => (
<li key={alert}>
<Button
icon="times"
content={alert}
color="average"
onClick={() => act('clear', { zone: alert })} />
</li>
))
) : (
<li className="color-good">
No Minor Alerts
</li>
)}
</ul>
</Section>
);
};