Skip to content

Commit

Permalink
here too
Browse files Browse the repository at this point in the history
  • Loading branch information
harryob committed Nov 25, 2023
1 parent af78811 commit 8403255
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tgui/packages/tgui/interfaces/Orbit/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,9 @@ const ObservableTooltip = (props: { item: Observable }) => {
const {
item: { caste, health, job, full_name, icon, background_color },
} = props;
const displayHealth = !!health && health >= 0 ? `${health}%` : 'Critical';

const displayHealth = typeof health === 'number';
const healthText = !!health && health >= 0 ? `${health}%` : 'Critical';

return (
<LabeledList>
Expand All @@ -275,8 +277,8 @@ const ObservableTooltip = (props: { item: Observable }) => {
{job}
</LabeledList.Item>
)}
{!!health && (
<LabeledList.Item label="Health">{displayHealth}</LabeledList.Item>
{displayHealth && (
<LabeledList.Item label="Health">{healthText}</LabeledList.Item>
)}
</LabeledList>
);
Expand Down

0 comments on commit 8403255

Please sign in to comment.