// Copyright 2019-2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import * as React from 'react';
import * as styles from './LabeledCheckbox.scss';
import { Inline } from './Typography';
export type Props = {
children: React.ReactNode;
value?: boolean;
onChange?: (value: boolean) => unknown;
};
const checkSvg = (
);
export const LabeledCheckbox = React.memo(
({ children, value, onChange }: Props) => {
const handleChange = React.useCallback(() => {
if (onChange !== undefined) {
onChange(!value);
}
}, [onChange, value]);
const className = value ? styles.checkboxChecked : styles.checkbox;
return (
);
}
);