Files
CHOMPStation2/tgui/packages/tgui/interfaces/PublicLibraryWiki/WikiPages/WikiSubPages/WikiGenePage.tsx
CHOMPStation2StaffMirrorBot 5886b748bf [MIRROR] Bingle them viruses (#11094)
Co-authored-by: Will <7099514+Willburd@users.noreply.github.com>
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
2025-06-20 11:30:14 +02:00

53 lines
1.6 KiB
TypeScript

import { Box, LabeledList, Section, Stack } from 'tgui-core/components';
import { capitalize } from 'tgui-core/string';
import { geneTypeToColor } from '../../constants';
import type { GeneData } from '../../types';
import { WikiList } from '../../WikiCommon/WikiListElements';
export const WikiGenePage = (props: { gene: GeneData }) => {
const {
title,
description,
trait_type,
bounds_off_min,
bounds_off_max,
bounds_on_min,
bounds_on_max,
blockers,
} = props.gene;
return (
<Section fill scrollable title={capitalize(title)}>
<Stack vertical fill>
<Stack.Item grow>
<LabeledList>
<LabeledList.Item label="Description">
<Box color={description ? undefined : 'label'}>
{description ? description : 'No information available!'}
</Box>
</LabeledList.Item>
<LabeledList.Divider />
<LabeledList.Item label="Type">
<Box color={geneTypeToColor[trait_type]}>{trait_type}</Box>
</LabeledList.Item>
<LabeledList.Item label="Active Range">
<Box color="green">
{bounds_on_min} - {bounds_on_max}
</Box>
</LabeledList.Item>
<LabeledList.Item label="Inactive Range">
<Box color="red">
{bounds_off_min} - {bounds_off_max}
</Box>
</LabeledList.Item>
{!!blockers && (
<WikiList entries={blockers} title="Suppressed By" />
)}
</LabeledList>
</Stack.Item>
</Stack>
</Section>
);
};