mirror of
https://github.com/be5invis/Iosevka.git
synced 2026-10-28 00:18:43 +00:00
23 lines
592 B
TypeScript
23 lines
592 B
TypeScript
import { joinCls } from "../utils/join-classes";
|
|
|
|
export type VariantsPanelCheckGroupProps = {
|
|
label: string | React.ReactElement;
|
|
value: boolean;
|
|
disabled?: boolean;
|
|
onChange: (x: boolean) => void;
|
|
};
|
|
export function CheckGroup(props: VariantsPanelCheckGroupProps) {
|
|
return (
|
|
<label className={joinCls("check-group", "extender", props.disabled ? "disabled" : "")}>
|
|
<input
|
|
type="checkbox"
|
|
disabled={props.disabled}
|
|
checked={props.value}
|
|
onChange={x => props.onChange(x.target.checked)}
|
|
/>
|
|
<span className="check-mark"></span>
|
|
{props.label}
|
|
</label>
|
|
);
|
|
}
|