您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

is-filled-picker.tsx 800B

12345678910111213141516171819202122232425262728
  1. import * as Checkbox from '@radix-ui/react-checkbox'
  2. import { CheckIcon } from '@radix-ui/react-icons'
  3. import { strokes } from 'lib/shape-styles'
  4. import { Square } from 'react-feather'
  5. import { IconWrapper, RowButton } from '../shared'
  6. interface Props {
  7. isFilled: boolean
  8. onChange: (isFilled: boolean) => void
  9. }
  10. export default function IsFilledPicker({ isFilled, onChange }: Props) {
  11. return (
  12. <Checkbox.Root
  13. as={RowButton}
  14. checked={isFilled}
  15. onCheckedChange={(e: React.ChangeEvent<HTMLInputElement>) =>
  16. onChange(e.currentTarget.checked)
  17. }
  18. >
  19. <label htmlFor="fill">Fill</label>
  20. <IconWrapper>
  21. {isFilled || <Square stroke={strokes.Black} />}
  22. <Checkbox.Indicator as={CheckIcon} />
  23. </IconWrapper>
  24. </Checkbox.Root>
  25. )
  26. }