import { useMemo } from "react"; import { faInfoCircle, faMagnifyingGlass, faSearch } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { EmptyState, Input, Pagination, Spinner, Tooltip } from "@app/components/v2"; import { useSubscription } from "@app/context"; import { SECRET_SYNC_MAP } from "@app/helpers/secretSyncs"; import { usePagination, usePopUp, useResetPageHelper } from "@app/hooks"; import { SecretSync, useSecretSyncOptions } from "@app/hooks/api/secretSyncs"; import { UpgradePlanModal } from "../license/UpgradePlanModal"; type Props = { onSelect: (destination: SecretSync) => void; }; export const SecretSyncSelect = ({ onSelect }: Props) => { const { subscription } = useSubscription(); const { isPending, data: secretSyncOptions } = useSecretSyncOptions(); const { popUp, handlePopUpOpen, handlePopUpToggle } = usePopUp(["upgradePlan"] as const); const { search, setSearch, setPage, page, perPage, setPerPage, offset } = usePagination("", { initPerPage: 16 }); const filteredOptions = useMemo( () => secretSyncOptions?.filter( ({ name, destination }) => name?.toLowerCase().includes(search.trim().toLowerCase()) || destination.toLowerCase().includes(search.toLowerCase()) ) ?? [], [secretSyncOptions, search] ); useResetPageHelper({ totalCount: filteredOptions.length, offset, setPage }); if (isPending) { return (

Loading options...

); } return (
setSearch(e.target.value)} leftIcon={} placeholder="Search options..." className="bg-mineshaft-800 placeholder:text-mineshaft-400" />
{filteredOptions.slice(offset, perPage * page)?.map(({ destination, enterprise }) => { const { image, name } = SECRET_SYNC_MAP[destination]; return ( ); })} {!filteredOptions?.length && ( )}
{Boolean(filteredOptions.length) && (

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 .

} >
Don't see the third-party service you're looking for?
} count={filteredOptions.length} page={page} perPage={perPage} onChangePage={setPage} onChangePerPage={setPerPage} perPageList={[16]} /> )} handlePopUpToggle("upgradePlan", isOpen)} text="You can use every Secret Sync if you switch to Infisical's Enterprise plan." />
); };