Merge branch 'develop' into fix/forms-margins-infrastructure-alignment

This commit is contained in:
Alexander Holliday authored and GitHub committed 2025-07-15 15:22:43 -07:00
commit e2f99f52db
7 files changed
+107 -31

No files matched your search

+10 -2
View File
@@ -25,6 +25,7 @@ import FieldWrapper from "../FieldWrapper";
* @param {Function} props.handleChange - Function to call when the input changes
* @param {Function} Prop.onBlur - Function to call when the input is blured
* @param {Object} props.sx - Additional styles to apply to the component
* @param {string} props.unit - Label to identify type of options
* @returns {JSX.Element} The rendered Search component
*/
@@ -75,6 +76,7 @@ const Search = ({
labelFontWeight,
labelVariant,
labelSx = {},
unit = "option",
}) => {
const theme = useTheme();
const { t } = useTranslation();
@@ -195,7 +197,12 @@ const Search = ({
);
if (filtered.length === 0) {
return [{ [filteredBy]: "No monitors found", noOptions: true }];
return [
{
[filteredBy]: t("general.noOptionsFound", { unit: unit }),
noOptions: true,
},
];
}
return filtered;
}}
@@ -290,7 +297,7 @@ Search.propTypes = {
options: PropTypes.array.isRequired,
filteredBy: PropTypes.string.isRequired,
secondaryLabel: PropTypes.string,
value: PropTypes.array,
value: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),
inputValue: PropTypes.string.isRequired,
handleInputChange: PropTypes.func.isRequired,
handleChange: PropTypes.func,
@@ -301,6 +308,7 @@ Search.propTypes = {
startAdornment: PropTypes.object,
endAdornment: PropTypes.object,
onBlur: PropTypes.func,
unit: PropTypes.string,
};
export default Search;