Skip to content

Commit

Permalink
feat: Show empty-state if checklist is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
lo5 committed Aug 17, 2022
1 parent ee2f0bb commit d09ed38
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions web/src/checklist.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,15 @@ export const Checklist = make(({ context, box }: BoxProps) => {
onChange={(_, checked) => onChecked(c.value, checked)}
/>
</div>
))
)),
contents = checkboxes.length
? <div className={css('flex flex-col gap-2', style)}>{checkboxes}</div>
: <div>&mdash;</div>

return (
<div className={css('flex flex-col gap-2')}>
{text && <Label>{text}</Label>}
<div className={css('flex flex-col gap-2', style)}>{checkboxes}</div>
{contents}
</div>
)
}
Expand Down

0 comments on commit d09ed38

Please sign in to comment.