diff --git a/frontend/app/components/Dashboard/components/DashboardList/Header.tsx b/frontend/app/components/Dashboard/components/DashboardList/Header.tsx index 8eb74ae6d..13cdeab99 100644 --- a/frontend/app/components/Dashboard/components/DashboardList/Header.tsx +++ b/frontend/app/components/Dashboard/components/DashboardList/Header.tsx @@ -1,27 +1,35 @@ import React from 'react'; -import {PageTitle} from 'UI'; +import { PageTitle } from 'UI'; import DashboardSearch from './DashboardSearch'; -import CreateDashboardButton from "Components/Dashboard/components/CreateDashboardButton"; +import CreateDashboardButton from 'Components/Dashboard/components/CreateDashboardButton'; +import { useStore } from 'App/mstore'; +import { observer } from 'mobx-react-lite'; function Header() { - return ( - <> -
-
- -
-
- -
-
- -
-
+ const { dashboardStore } = useStore(); + const list = dashboardStore.filteredList; + const dashboardsSearch = dashboardStore.filter.query; + const showSearch = list.length > 0 || dashboardsSearch; + return ( + <> +
+
+ +
+ {showSearch && ( +
+ +
+
+
- - ); +
+ )} +
+ + ); } -export default Header; +export default observer(Header);