ぼざクリ タグ広場 https://hub.nizika.monster
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

29 lines
822 B

  1. import React from 'react'
  2. type Props = { children: React.ReactNode
  3. checkBox?: { label: string
  4. checked: boolean
  5. onChange: (event: React.ChangeEvent<HTMLInputElement>) => void } }
  6. export default ({ children, checkBox }: Props) => {
  7. if (!(checkBox))
  8. {
  9. return (
  10. <label className="block font-semibold mb-1">
  11. {children}
  12. </label>)
  13. }
  14. return (
  15. <div className="flex gap-2 mb-1">
  16. <label className="flex-1 block font-semibold">{children}</label>
  17. <label className="flex items-center block gap-1">
  18. <input type="checkbox"
  19. checked={checkBox.checked}
  20. onChange={checkBox.onChange} />
  21. {checkBox.label}
  22. </label>
  23. </div>)
  24. }