| 1 |
export interface FormSelectOptionProps extends Omit<React.HTMLProps<HTMLOptionElement>, 'disabled'> { |
| 2 |
/** additional classes added to the Select Option */ |
| 3 |
className?: string; |
| 4 |
/** the value for the option */ |
| 5 |
value?: any; |
| 6 |
/** the label for the option */ |
| 7 |
label: string; |
| 8 |
/** flag indicating if the option is disabled */ |
| 9 |
isDisabled?: boolean; |
| 10 |
/** flag indicating if option will have placeholder styling applied when selected **/ |
| 11 |
isPlaceholder?: boolean; |
| 12 |
} |
| 13 |
|
| 14 |
export const FormSelectOption: React.FunctionComponent<FormSelectOptionProps> = ({ |
| 15 |
className = '', |
| 16 |
value = '', |
| 17 |
isDisabled = false, |
| 18 |
label, |
| 19 |
// eslint-disable-next-line @typescript-eslint/no-unused-vars |
| 20 |
isPlaceholder = false, |
| 21 |
...props |
| 22 |
}: FormSelectOptionProps) => ( |
| 23 |
<option {...props} className={className} value={value} disabled={isDisabled}> |
| 24 |
{label} |
| 25 |
</option> |
| 26 |
); |
| 27 |
FormSelectOption.displayName = 'FormSelectOption'; |