forked from github/plane
* chore: swap input component with plane/ui package * chore: swap textarea component with plane/ui package * chore: swap button component with plane/ui package * chore: button component revamp * fix: button type fix * chore: secondary button revamp * chore: button props updated * chore: swap loader component with plane/ui package * fix: build error fix * chore: button component refactor * chore: code refactor * chore: swap toggle switch component with plane/ui package * chore: swap spinner component with plane/ui package * chore: swap progress bar componenet with plan/ui package * chore: code refactor
42 lines
1.0 KiB
TypeScript
42 lines
1.0 KiB
TypeScript
import { observer } from "mobx-react-lite";
|
|
|
|
// mobx store
|
|
import { useMobxStore } from "lib/mobx/store-provider";
|
|
// components
|
|
import { GlobalViewListItem } from "components/workspace";
|
|
// ui
|
|
import { Loader } from "@plane/ui";
|
|
|
|
type Props = {
|
|
searchQuery: string;
|
|
};
|
|
|
|
export const GlobalViewsList: React.FC<Props> = observer((props) => {
|
|
const { searchQuery } = props;
|
|
|
|
const { globalViews: globalViewsStore } = useMobxStore();
|
|
|
|
const viewsList = globalViewsStore.globalViewsList;
|
|
|
|
if (!viewsList)
|
|
return (
|
|
<Loader className="space-y-1.5">
|
|
<Loader.Item height="72px" />
|
|
<Loader.Item height="72px" />
|
|
<Loader.Item height="72px" />
|
|
<Loader.Item height="72px" />
|
|
<Loader.Item height="72px" />
|
|
</Loader>
|
|
);
|
|
|
|
const filteredViewsList = viewsList.filter((v) => v.name.toLowerCase().includes(searchQuery.toLowerCase()));
|
|
|
|
return (
|
|
<>
|
|
{filteredViewsList.map((view) => (
|
|
<GlobalViewListItem key={view.id} view={view} />
|
|
))}
|
|
</>
|
|
);
|
|
});
|