diff --git a/client/src/Components/design-elements/Chip.tsx b/client/src/Components/design-elements/Chip.tsx deleted file mode 100644 index c5a902feb..000000000 --- a/client/src/Components/design-elements/Chip.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import MuiChip from "@mui/material/Chip"; -import Typography from "@mui/material/Typography"; -import { useTheme } from "@mui/material"; -interface ChipProps { - text: string; - color?: string; -} - -export const Chip = ({ text, color }: ChipProps) => { - const theme = useTheme(); - const textColor = color - ? theme.palette.getContrastText(color) - : theme.palette.text.primary; - return ( - - {text} - - } - sx={{ - backgroundColor: color, - }} - /> - ); -}; diff --git a/client/src/Components/design-elements/StatusLabel.tsx b/client/src/Components/design-elements/StatusLabel.tsx index ee9a749c2..c3fd089d7 100644 --- a/client/src/Components/design-elements/StatusLabel.tsx +++ b/client/src/Components/design-elements/StatusLabel.tsx @@ -100,10 +100,7 @@ export const ColoredLabel = ({ text, color }: { text: string; color: string }) = return ( ["renderInput"]; fieldLabel?: string; required?: boolean; + renderOptionContent?: (option: any) => React.ReactNode; }; export const AutoCompleteInput = ({ fieldLabel, required, renderInput, + renderOptionContent, ...props }: AutoCompleteInputProps) => { const theme = useTheme(); const multiple = props.multiple; - + const { renderOption: customRenderOption, ...autocompleteProps } = props; const defaultRenderInput = (params: any) => ( option.id} renderTags={() => null} - renderOption={(props, option, { selected }) => { - const { key, ...optionProps } = props; - return ( - - { + const { key, ...optionProps } = props; + return ( + - {multiple && } - {option.name} - - - ); - }} + + {multiple && } + {renderOptionContent ? renderOptionContent(option) : option.name} + + + ); + }) + } sx={{ "&.MuiAutocomplete-root .MuiAutocomplete-input": { padding: `0 ${theme.spacing(5)}`,