+
+ {
+ showCheckbox && (
+ setData({ ...data, loading: true, hideDeprecated: !data.hideDeprecated })}
+ />
+ )
+ }
+
+
+
+ setData({ ...data, searchText: event.target.value })}
+ />
+ { data.searchText && renderClear() }
+ { renderLens() }
+
+
+
+ );
+};
+
+export default FilterProvisionInstance;
+
+FilterProvisionInstance.propTypes = {
+ hideDeprecated: PropTypes.bool,
+ searchText: PropTypes.string.isRequired,
+ url: PropTypes.string.isRequired,
+ showCheckbox: PropTypes.bool.isRequired,
+};
+
+FilterProvisionInstance.defaultProps = {
+ hideDeprecated: false,
+};
diff --git a/app/javascript/components/instance-filter/instance-filter.jsx b/app/javascript/components/instance-filter/instance-filter.jsx
new file mode 100644
index 00000000000..d4756b9336e
--- /dev/null
+++ b/app/javascript/components/instance-filter/instance-filter.jsx
@@ -0,0 +1,83 @@
+import React, { useState, useEffect } from 'react';
+import PropTypes from 'prop-types';
+import { Search32, Close32 } from '@carbon/icons-react';
+import { Button, Checkbox, TextInput } from 'carbon-components-react';
+
+/** Component to filter the images at provisioning instances page. */
+const InstanceFilter = ({
+ searchText, url,
+}) => {
+ console.log('Props received:', { searchText, url });
+ const [data, setData] = useState({
+ loading: false,
+ searchText,
+ });
+
+ useEffect(() => {
+ if (data.loading) {
+ $.post(`${url}?search_text=${encodeURIComponent(data.searchText)}`);
+ }
+ }, [data.loading]);
+
+ /** Function to handle the clear button's click event of the search bar. */
+ const onClear = () => {
+ const updatedData = searchText ? { loading: true } : {};
+ setData({ ...data, searchText: '', ...updatedData });
+ };
+
+ /** Function to render the Clear button. */
+ const renderClear = () => (
+