diff --git a/striker-ui/components/OutlinedInputWithLabel.tsx b/striker-ui/components/OutlinedInputWithLabel.tsx index b56038ee..5165a947 100644 --- a/striker-ui/components/OutlinedInputWithLabel.tsx +++ b/striker-ui/components/OutlinedInputWithLabel.tsx @@ -3,6 +3,7 @@ import { FormControlProps as MUIFormControlProps, } from '@mui/material'; +import MessageBox, { MessageBoxProps } from './MessageBox'; import OutlinedInput, { OutlinedInputProps } from './OutlinedInput'; import OutlinedInputLabel, { OutlinedInputLabelProps, @@ -13,6 +14,7 @@ type OutlinedInputWithLabelOptionalProps = { id?: string; inputProps?: Partial; inputLabelProps?: Partial; + messageBoxProps?: Partial; }; type OutlinedInputWithLabelProps = { @@ -25,6 +27,7 @@ const OUTLINED_INPUT_WITH_LABEL_DEFAULT_PROPS: Required ( - // eslint-disable-next-line react/jsx-props-no-spreading - - {/* eslint-disable-next-line react/jsx-props-no-spreading */} - - {label} - - - -); + messageBoxProps = OUTLINED_INPUT_WITH_LABEL_DEFAULT_PROPS.messageBoxProps, +}: OutlinedInputWithLabelProps): JSX.Element => { + const { + sx: messageBoxSx, + text: messageBoxText, + ...messageBoxRestProps + } = messageBoxProps; + + return ( + // eslint-disable-next-line react/jsx-props-no-spreading + + {/* eslint-disable-next-line react/jsx-props-no-spreading */} + + {label} + + + {messageBoxText && ( + + )} + + ); +}; OutlinedInputWithLabel.defaultProps = OUTLINED_INPUT_WITH_LABEL_DEFAULT_PROPS;