| 1 |
import { Checkmark } from '@onboarding/svg' |
| 2 |
|
| 3 |
export const CheckboxInputCard = ({ |
| 4 |
label, |
| 5 |
slug, |
| 6 |
description, |
| 7 |
checked, |
| 8 |
onChange, |
| 9 |
Icon, |
| 10 |
}) => { |
| 11 |
return ( |
| 12 |
<label |
| 13 |
className="w-full flex items-center justify-between text-gray-900 font-semibold p-4" |
| 14 |
htmlFor={slug}> |
| 15 |
<div className="flex items-center flex-auto"> |
| 16 |
<span className="mt-0.5 w-6 h-6 relative inline-block mr-3 align-middle"> |
| 17 |
<input |
| 18 |
id={slug} |
| 19 |
className="h-5 w-5 rounded-sm" |
| 20 |
type="checkbox" |
| 21 |
onChange={onChange} |
| 22 |
defaultChecked={checked} |
| 23 |
/> |
| 24 |
<Checkmark |
| 25 |
className="absolute components-checkbox-control__checked" |
| 26 |
style={{ width: 24, color: '#fff' }} |
| 27 |
role="presentation" |
| 28 |
/> |
| 29 |
</span> |
| 30 |
<span> |
| 31 |
<span className="text-base">{label}</span> |
| 32 |
{description ? ( |
| 33 |
<span className="block pt-1 text-gray-700 pr-4 font-normal"> |
| 34 |
{description} |
| 35 |
</span> |
| 36 |
) : ( |
| 37 |
<span></span> |
| 38 |
)} |
| 39 |
</span> |
| 40 |
</div> |
| 41 |
{Icon && ( |
| 42 |
<Icon className="flex-none text-partner-primary-bg h-6 w-6" /> |
| 43 |
)} |
| 44 |
</label> |
| 45 |
) |
| 46 |
} |
| 47 |
|