Skip to content

Commit

Permalink
BooleanAsIconWidget: Add support for JsonTypes.number
Browse files Browse the repository at this point in the history
Change-type: minor
  • Loading branch information
myarmolinsky committed Dec 12, 2024
1 parent ea11957 commit 446b577
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/Widget/Formats/BooleanAsIconWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ const { Box, Typography } = Material;

export const BooleanAsIconWidget = widgetFactory('BooleanAsIcon', {}, [
JsonTypes.boolean,
JsonTypes.number,
JsonTypes.null,
])(({ value }) => {
const text = value ? 'true' : 'false';
const text = Boolean(value) ? 'true' : 'false';
return (
<Box alignItems="center" gap={2}>
<FontAwesomeIcon icon={value ? faCheckCircle : faTimesCircle} />{' '}
Expand Down

0 comments on commit 446b577

Please sign in to comment.