Skip to content

Commit

Permalink
Add IRadioOption
Browse files Browse the repository at this point in the history
  • Loading branch information
sggerard committed Jan 6, 2025
1 parent c308922 commit 7e3757c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
4 changes: 2 additions & 2 deletions services/common/src/components/forms/RenderRadioButtons.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { FC, useContext } from "react";
import { Form, Radio } from "antd";
import { BaseInputProps, BaseViewInput, getFormItemLabel } from "@mds/common/components/forms/BaseInput";
import { IOption } from "@mds/common/interfaces";
import { IRadioOption } from "@mds/common/interfaces";
import { FormContext } from "./FormWrapper";

/**
Expand All @@ -10,7 +10,7 @@ import { FormContext } from "./FormWrapper";

interface RenderRadioButtonsProps extends BaseInputProps {
label: string;
customOptions?: IOption[];
customOptions?: IRadioOption[];
optionType?: "default" | "button";
isVertical?: boolean;
}
Expand Down
7 changes: 6 additions & 1 deletion services/common/src/interfaces/common/option.interface.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
export interface IOption {
label: string;
value: string | number ;
value: string | number;
tooltip?: string;
}

export interface IRadioOption {
label: string;
value: boolean | string;
}

export interface IGroupedDropdownList {
groupName: string | number;
opt: IOption[];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { FC } from "react";
import { Form, Radio, Space } from "antd";
import { IRadioOption } from "@mds/common/interfaces";

/**
* @class RenderRadioButtons - Ant Design `Radio` component used for boolean values in redux-form.
Expand All @@ -17,7 +18,7 @@ interface RenderRadioButtonsProps {
disabled: boolean;
input: any;
isVertical?: boolean;
customOptions: { label: string; value: any }[];
customOptions: IRadioOption[];
}

const RenderRadioButtons: FC<RenderRadioButtonsProps> = (props) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { FC } from "react";
import { Form, Radio } from "antd";
import { IRadioOption } from "@mds/common/interfaces";

/**
* @class RenderRadioButtons - Ant Design `Radio` component used for boolean values in redux-form.
Expand All @@ -16,7 +17,7 @@ interface RenderRadioButtonsProps {
meta: any;
disabled: boolean;
input: any;
customOptions: { label: string; value: any }[];
customOptions: IRadioOption[];
}

const RenderRadioButtons: FC<RenderRadioButtonsProps> = (props) => {
Expand Down

0 comments on commit 7e3757c

Please sign in to comment.