import { faPlus } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal"; import { ProjectPermissionCan } from "@app/components/permissions"; import { CreateSecretScanningDataSourceModal } from "@app/components/secret-scanning"; import { Button, Spinner } from "@app/components/v2"; import { DocumentationLinkBadge } from "@app/components/v3"; import { ProjectPermissionSub, useProject, useSubscription } from "@app/context"; import { ProjectPermissionSecretScanningDataSourceActions } from "@app/context/ProjectPermissionContext/types"; import { usePopUp } from "@app/hooks"; import { useListSecretScanningDataSources } from "@app/hooks/api/secretScanningV2"; import { SecretScanningDataSourcesTable } from "./SecretScanningDataSourcesTable"; export const SecretScanningDataSourcesSection = () => { const { popUp, handlePopUpOpen, handlePopUpToggle } = usePopUp([ "addDataSource", "upgradePlan" ] as const); const { subscription } = useSubscription(); const { currentProject } = useProject(); const { data: dataSources = [], isPending: isDataSourcesPending } = useListSecretScanningDataSources(currentProject.id, { refetchInterval: 30000, enabled: subscription.secretScanning }); if (subscription.secretScanning && isDataSourcesPending) return (
); return ( <>

Data Sources

Configure Data Sources to scan for secret leaks from third-party services.

{(isAllowed) => ( )}
handlePopUpToggle("addDataSource", isOpen)} /> handlePopUpToggle("upgradePlan", isOpen)} text="You can create Data Sources by upgrading to Infisical's Enterprise plan." isEnterpriseFeature={popUp.upgradePlan.data?.isEnterpriseFeature} /> ); };