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.
 
 
 
 
spa_instat_tv/src/features/Common/Checkbox/index.tsx

35 lines
511 B

import { InputHTMLAttributes } from 'react'
import {
Wrapper,
Input,
Label,
} from './styled'
type Props = Pick<InputHTMLAttributes<HTMLInputElement>, (
| 'checked'
| 'id'
| 'name'
| 'onClick'
)> & {
label?: string,
}
export const Checkbox = ({
checked,
id,
label,
name,
onClick,
}: Props) => (
<Wrapper>
<Input
id={id}
type='checkbox'
name={name}
checked={checked}
onClick={onClick}
/>
<Label htmlFor={id}>{label}</Label>
</Wrapper>
)