diff --git a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionList.tsx b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionList.tsx index 1f11ce363..2087ebf63 100644 --- a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionList.tsx +++ b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionList.tsx @@ -1,11 +1,12 @@ -import { faWrench } from "@fortawesome/free-solid-svg-icons"; +import { useMemo } from "react"; +import { faInfoCircle, faMagnifyingGlass, faSearch } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal"; -import { Spinner, Tooltip } from "@app/components/v2"; +import { EmptyState, Input, Pagination, Spinner, Tooltip } from "@app/components/v2"; import { useSubscription } from "@app/context"; import { APP_CONNECTION_MAP } from "@app/helpers/appConnections"; -import { usePopUp } from "@app/hooks"; +import { usePagination, usePopUp, useResetPageHelper } from "@app/hooks"; import { useAppConnectionOptions } from "@app/hooks/api/appConnections"; import { AppConnection } from "@app/hooks/api/appConnections/enums"; @@ -19,6 +20,26 @@ export const AppConnectionsSelect = ({ onSelect }: Props) => { const { popUp, handlePopUpOpen, handlePopUpToggle } = usePopUp(["upgradePlan"] as const); + const { search, setSearch, setPage, page, perPage, setPerPage, offset } = usePagination("", { + initPerPage: 16 + }); + + const filteredOptions = useMemo( + () => + appConnectionOptions?.filter( + ({ name, app }) => + name?.toLowerCase().includes(search.trim().toLowerCase()) || + app.toLowerCase().includes(search.toLowerCase()) + ) ?? [], + [appConnectionOptions, search] + ); + + useResetPageHelper({ + totalCount: filteredOptions.length, + offset, + setPage + }); + if (isPending) { return (
Infisical is constantly adding support for more services.
++ {`If you don't see the third-party + service you're looking for,`}{" "} + + let us know on Slack + {" "} + or{" "} + + make a request on GitHub + + . +
+ > + } + > +Infisical is constantly adding support for more connections.
-- {`If you don't see the third-party - app you're looking for,`}{" "} - - let us know on Slack - {" "} - or{" "} - - make a request on GitHub - - . -
- > - } - > -