2021-08-22 12:05:07 +03:00
|
|
|
import { ChangeEvent, FC } from 'react';
|
2021-06-23 20:52:19 +03:00
|
|
|
import Checkbox from '../../utils/Checkbox';
|
2021-08-22 12:05:07 +03:00
|
|
|
import { InfoTooltip } from '../../utils/InfoTooltip';
|
2021-06-23 20:52:19 +03:00
|
|
|
|
|
|
|
interface ShortUrlFormCheckboxGroupProps {
|
|
|
|
checked?: boolean;
|
|
|
|
onChange?: (checked: boolean, e: ChangeEvent<HTMLInputElement>) => void;
|
|
|
|
infoTooltip?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export const ShortUrlFormCheckboxGroup: FC<ShortUrlFormCheckboxGroupProps> = (
|
|
|
|
{ children, infoTooltip, checked, onChange },
|
|
|
|
) => (
|
|
|
|
<p>
|
|
|
|
<Checkbox inline checked={checked} className={infoTooltip ? 'mr-2' : ''} onChange={onChange}>
|
|
|
|
{children}
|
|
|
|
</Checkbox>
|
2021-08-22 12:05:07 +03:00
|
|
|
{infoTooltip && <InfoTooltip placement="right">{infoTooltip}</InfoTooltip>}
|
2021-06-23 20:52:19 +03:00
|
|
|
</p>
|
|
|
|
);
|