feat: add search functionality to infrastructure moniter
This commit is contained in:
1 parent
275f2384c0
commit
7189c19d55
9 files changed
+158
-21
No files matched your search
@@ -8,6 +8,7 @@ import Pagination from "../../..//Components/Table/TablePagination";
|
||||
import GenericFallback from "../../../Components/GenericFallback";
|
||||
import Fallback from "../../../Components/Fallback";
|
||||
import Filter from "./Components/Filters";
|
||||
import SearchComponent from "./Components/SearchComponent";
|
||||
// Utils
|
||||
import { useTheme } from "@emotion/react";
|
||||
import { useMonitorFetch } from "./Hooks/useMonitorFetch";
|
||||
@@ -24,6 +25,8 @@ const InfrastructureMonitors = () => {
|
||||
const [updateTrigger, setUpdateTrigger] = useState(false);
|
||||
const [selectedStatus, setSelectedStatus] = useState(undefined);
|
||||
const [toFilterStatus, setToFilterStatus] = useState(undefined);
|
||||
const [search, setSearch] = useState(undefined);
|
||||
const [isSearching, setIsSearching] = useState(false);
|
||||
|
||||
// Utils
|
||||
const theme = useTheme();
|
||||
@@ -56,6 +59,7 @@ const InfrastructureMonitors = () => {
|
||||
filter: toFilterStatus,
|
||||
rowsPerPage,
|
||||
updateTrigger,
|
||||
search
|
||||
});
|
||||
|
||||
if (networkError === true) {
|
||||
@@ -108,12 +112,19 @@ const InfrastructureMonitors = () => {
|
||||
setToFilterStatus={setToFilterStatus}
|
||||
handleReset={handleReset}
|
||||
/>
|
||||
<SearchComponent
|
||||
monitors={monitors}
|
||||
onSearchChange={setSearch}
|
||||
setIsSearching={setIsSearching}
|
||||
/>
|
||||
</Stack>
|
||||
|
||||
<MonitorsTable
|
||||
shouldRender={!isLoading}
|
||||
monitors={monitors}
|
||||
isAdmin={isAdmin}
|
||||
handleActionMenuDelete={handleActionMenuDelete}
|
||||
isSearching={isSearching}
|
||||
/>
|
||||
<Pagination
|
||||
itemCount={summary?.totalMonitors}
|
||||
|
||||
Reference in new issue
Block a user