diff --git a/Client/src/Components/Inputs/Search/index.jsx b/Client/src/Components/Inputs/Search/index.jsx index fa04ab388..fbfd9b00c 100644 --- a/Client/src/Components/Inputs/Search/index.jsx +++ b/Client/src/Components/Inputs/Search/index.jsx @@ -15,6 +15,29 @@ import SearchIcon from "../../../assets/icons/search.svg?react"; * @param {Object} props.sx - Additional styles to apply to the component * @returns {JSX.Element} The rendered Search component */ + +const SearchAdornment = () => { + const theme = useTheme(); + return ( + + + + ); +}; + const Search = ({ id, options, @@ -24,11 +47,14 @@ const Search = ({ handleInputChange, handleChange, sx, + multiple = false, + isAdorned = true, }) => { const theme = useTheme(); return ( { @@ -38,7 +64,7 @@ const Search = ({ handleChange && handleChange(newValue); }} fullWidth - // freeSolo + freeSolo disableClearable options={options} getOptionLabel={(option) => option[filteredBy]} @@ -48,24 +74,7 @@ const Search = ({ placeholder="Type to search" InputProps={{ ...params.InputProps, - startAdornment: ( - - - - ), + ...(isAdorned && { startAdornment: }), }} sx={{ "& fieldset": { @@ -141,12 +150,14 @@ const Search = ({ Search.propTypes = { id: PropTypes.string, + multiple: PropTypes.bool, options: PropTypes.array.isRequired, filteredBy: PropTypes.string.isRequired, secondaryLabel: PropTypes.string, value: PropTypes.string.isRequired, handleInputChange: PropTypes.func.isRequired, handleChange: PropTypes.func, + isAdorned: PropTypes.bool, sx: PropTypes.object, }; diff --git a/Client/src/Components/Inputs/Select/index.jsx b/Client/src/Components/Inputs/Select/index.jsx index 3d34fcca5..00cceaa29 100644 --- a/Client/src/Components/Inputs/Select/index.jsx +++ b/Client/src/Components/Inputs/Select/index.jsx @@ -34,6 +34,7 @@ import "./index.css"; * * {}} + value={getIdByValue(repeatConfig, form.repeat)} + onChange={(event) => { + handleFormChange( + "repeat", + getValueById(repeatConfig, event.target.value) + ); + }} items={repeatConfig} /> @@ -156,6 +191,9 @@ const CreateMaintenance = () => { }, }} sx={{}} + onChange={(newDate) => { + handleTimeChange("startDate", newDate.toISOString()); + }} /> @@ -172,12 +210,39 @@ const CreateMaintenance = () => { - {}} + onChange={(event) => { + handleFormChange( + "durationUnit", + getValueById(durationConfig, event.target.value) + ); + }} /> @@ -216,7 +294,10 @@ const CreateMaintenance = () => { { + handleFormChange("name", event.target.value); + }} /> @@ -228,12 +309,14 @@ const CreateMaintenance = () => { @@ -251,7 +334,7 @@ const CreateMaintenance = () => {