| 1 |
import { Checkmark } from '@onboarding/svg' |
| 2 |
|
| 3 |
export const CheckboxInput = ({ |
| 4 |
label, |
| 5 |
slug, |
| 6 |
description, |
| 7 |
checked, |
| 8 |
onChange, |
| 9 |
}) => { |
| 10 |
return ( |
| 11 |
<label |
| 12 |
className="flex items-baseline hover:text-partner-primary-bg focus-within:text-partner-primary-bg" |
| 13 |
htmlFor={slug}> |
| 14 |
<span className="mt-0.5 w-6 h-6 relative inline-block mr-3 align-middle"> |
| 15 |
<input |
| 16 |
id={slug} |
| 17 |
className="h-5 w-5 rounded-sm" |
| 18 |
type="checkbox" |
| 19 |
onChange={onChange} |
| 20 |
defaultChecked={checked} |
| 21 |
/> |
| 22 |
<Checkmark |
| 23 |
className="absolute components-checkbox-control__checked" |
| 24 |
style={{ width: 24, color: '#fff' }} |
| 25 |
role="presentation" |
| 26 |
/> |
| 27 |
</span> |
| 28 |
<span> |
| 29 |
<span className="text-base">{label}</span> |
| 30 |
{description ? ( |
| 31 |
<span className="block pt-1">{description}</span> |
| 32 |
) : ( |
| 33 |
<span></span> |
| 34 |
)} |
| 35 |
</span> |
| 36 |
</label> |
| 37 |
) |
| 38 |
} |
| 39 |
|