diff --git a/tgui/packages/tgui/interfaces/AtmosControl.tsx b/tgui/packages/tgui/interfaces/AtmosControl.tsx index 062ff6864ae..d39825793fa 100644 --- a/tgui/packages/tgui/interfaces/AtmosControl.tsx +++ b/tgui/packages/tgui/interfaces/AtmosControl.tsx @@ -2,7 +2,7 @@ import { useState } from 'react'; import { useBackend } from 'tgui/backend'; import { NanoMap } from 'tgui/components'; import { Window } from 'tgui/layouts'; -import { Box, Button, Icon, Section, Tabs } from 'tgui-core/components'; +import { Box, Button, Icon, Section, Stack, Tabs } from 'tgui-core/components'; type alarm = { name: string; @@ -21,7 +21,7 @@ type Data = { export const AtmosControl = (props) => { return ( - + @@ -37,69 +37,70 @@ export const AtmosControlContent = (props) => { const [tabIndex, setTabIndex] = useState(0); const [zoom, setZoom] = useState(1); - let body; - // Alarms View - if (tabIndex === 0) { - body = ( -
- {alarms.map((alarm) => ( - - ))} -
- ); - } else if (tabIndex === 1) { - // Please note, if you ever change the zoom values, - // you MUST update styles/components/Tooltip.scss - // and change the @for scss to match. - body = ( - - setZoom(v)}> - {alarms - .filter((x) => ~~x.z === ~~config.mapZLevel) - .map((cm) => ( - act('alarm', { alarm: cm.ref })} - /> - ))} - - - ); - } + const tab: React.JSX.Element[] = []; + + tab[0] = ( +
+ {alarms.map((alarm) => ( + + ))} +
+ ); + // Please note, if you ever change the zoom values, + // you MUST update styles/components/Tooltip.scss + // and change the @for scss to match. + tab[1] = ( + + setZoom(v)}> + {alarms + .filter((x) => ~~x.z === ~~config.mapZLevel) + .map((cm) => ( + act('alarm', { alarm: cm.ref })} + /> + ))} + + + ); return ( - <> - - setTabIndex(0)} - > - Alarm View - - setTabIndex(1)} - > - Map View - - - {body} - + + + + setTabIndex(0)} + > + Alarm View + + setTabIndex(1)} + > + Map View + + + + + {tab[tabIndex]} + + ); };