import { toFixed } from 'common/math'; import { Fragment } from 'inferno'; import { useBackend } from '../backend'; import { Box, Button, Flex, LabeledList, Section, NoticeBox } from '../components'; import { Window } from '../layouts'; import { RankIcon } from './common/RankIcon'; export const TimeClock = (props, context) => { const { act, data } = useBackend(context); const { department_hours, user_name, card, assignment, job_datum, allow_change_job, job_choices } = data; return (
OOC Note: PTO acquired is account-wide and shared across all characters. Info listed below is not IC information.
{Object.keys(department_hours).map((key) => ( 6 ? 'good' : department_hours[key] > 1 ? 'average' : 'bad'}> {toFixed(department_hours[key], 1)} {department_hours[key] === 1 ? 'hour' : 'hours'} ))}
{!!job_datum && ( {job_datum.title} {job_datum.departments} {job_datum.economic_modifier} {(job_datum.timeoff_factor > 0 && Earns PTO - {job_datum.pto_department}) || (job_datum.timeoff_factor < 0 && Requires PTO - {job_datum.pto_department}) || ( Neutral )} )}
{!!(allow_change_job && job_datum && job_datum.timeoff_factor !== 0 && assignment !== 'Dismissed') && (
{(job_datum.timeoff_factor > 0 && ((department_hours[job_datum.pto_department] > 0 && ( )) || Warning: You do not have enough accrued time off to go off-duty.)) || (Object.keys(job_choices).length && Object.keys(job_choices).map((job) => { let alt_titles = job_choices[job]; return alt_titles.map((title) => ( )); })) || No Open Positions - See Head Of Personnel}
)}
); };