96db414ca1
* Use ChoicesToggleGroup for categories vs following * Edit categories modal * Filter closed and resolved using Configure. Set page to 0. * Add useEvent hook, incase we want to use it before React releases it. * useMemo on filters computation * Try to fix prettier * Use check box! Add select all/none button
32 lines
866 B
TypeScript
32 lines
866 B
TypeScript
import clsx from 'clsx'
|
|
|
|
export function Checkbox(props: {
|
|
label: string
|
|
checked: boolean
|
|
toggle: (checked: boolean) => void
|
|
className?: string
|
|
}) {
|
|
const { label, checked, toggle, className } = props
|
|
|
|
return (
|
|
<div className={clsx(className, 'space-y-5')}>
|
|
<div className="relative flex items-start">
|
|
<div className="flex h-6 items-center">
|
|
<input
|
|
id={label}
|
|
type="checkbox"
|
|
className="h-5 w-5 rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"
|
|
checked={checked}
|
|
onChange={(e) => toggle(!e.target.checked)}
|
|
/>
|
|
</div>
|
|
<div className="ml-3">
|
|
<label htmlFor={label} className="font-medium text-gray-700">
|
|
{label}
|
|
</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|