Skip to content

Commit

Permalink
feat: add tooltip support to radio group (#1378)
Browse files Browse the repository at this point in the history
  • Loading branch information
setchy authored Jul 15, 2024
1 parent 361b662 commit c8f44f2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/components/fields/RadioGroup.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import type { ChangeEvent, FC, ReactNode } from 'react';
import type { RadioGroupItem } from '../../types';
import { cn } from '../../utils/cn';
import { Tooltip } from './Tooltip';

export interface IRadioGroup {
name: string;
label: string;
helpText?: ReactNode | string;
tooltip?: ReactNode | string;
options: RadioGroupItem[];
value: string;
disabled?: boolean;
Expand All @@ -26,6 +28,9 @@ export const RadioGroup: FC<IRadioGroup> = (props: IRadioGroup) => {
}
>
{props.label}
{props.tooltip && (
<Tooltip name={`tooltip-${props.name}`} tooltip={props.tooltip} />
)}
</label>
</div>

Expand Down

0 comments on commit c8f44f2

Please sign in to comment.