mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2024-12-24 09:58:21 +03:00
20 lines
728 B
TypeScript
20 lines
728 B
TypeScript
import type { ChangeEvent, FC, PropsWithChildren } from 'react';
|
|
import { Checkbox } from '../../../src/utils/Checkbox';
|
|
import { InfoTooltip } from '../../../src/utils/InfoTooltip';
|
|
|
|
type ShortUrlFormCheckboxGroupProps = PropsWithChildren<{
|
|
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 ? 'me-2' : ''} onChange={onChange}>
|
|
{children}
|
|
</Checkbox>
|
|
{infoTooltip && <InfoTooltip placement="right">{infoTooltip}</InfoTooltip>}
|
|
</p>
|
|
);
|