import { round } from 'common/math'; import { Fragment } from 'inferno'; import { useBackend } from '../backend'; import { Box, Button, Dimmer, Flex, Icon, LabeledList, NoticeBox, ProgressBar, Section, Tabs } from '../components'; import { ComplexModal, modalRegisterBodyOverride } from '../interfaces/common/ComplexModal'; import { Window } from '../layouts'; const MENU_MAIN = 1; const MENU_BODY = 2; const MENU_MIND = 3; const viewMindRecordModalBodyOverride = (modal, context) => { const { act, data } = useBackend(context); const { activerecord, realname, obviously_dead, oocnotes, can_sleeve_active } = modal.args; return (
act('modal_close')} />}> {realname} {obviously_dead}
); }; const viewBodyRecordModalBodyOverride = (modal, context) => { const { act, data } = useBackend(context); const { activerecord, realname, species, sex, mind_compat, synthetic, oocnotes, can_grow_active } = modal.args; return (
act('modal_close')} />}> {realname} {species} {sex} {mind_compat} {synthetic ? 'Yes' : 'No'}
{oocnotes}
); }; export const ResleevingConsole = (props, context) => { const { act, data } = useBackend(context); const { menu, coredumped, emergency } = data; let body = (
); if (coredumped) { body = ; } if (emergency) { body = ; } modalRegisterBodyOverride('view_b_rec', viewBodyRecordModalBodyOverride); modalRegisterBodyOverride('view_m_rec', viewMindRecordModalBodyOverride); return ( {body} ); }; const ResleevingConsoleNavigation = (props, context) => { const { act, data } = useBackend(context); const { menu } = data; return ( act('menu', { num: MENU_MAIN, }) }> Main act('menu', { num: MENU_BODY, }) }> Body Records act('menu', { num: MENU_MIND, }) }> Mind Records ); }; const ResleevingConsoleBody = (props, context) => { const { data } = useBackend(context); const { menu, bodyrecords, mindrecords } = data; let body; if (menu === MENU_MAIN) { body = ; } else if (menu === MENU_BODY) { body = ; } else if (menu === MENU_MIND) { body = ; } return body; }; const ResleevingConsoleCoreDump = (props, context) => { return (

TransCore dump completed. Resleeving offline.

); }; const ResleevingConsoleDiskPrep = (props, context) => { const { act } = useBackend(context); return (

TRANSCORE DUMP

!!WARNING!!

This will transfer all minds to the dump disk, and the TransCore will be made unusable until post-shift maintenance! This should only be used in emergencies!