import { faPlus } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal"; import { createNotification } from "@app/components/notifications"; import { ProjectPermissionCan } from "@app/components/permissions"; import { Button, DeleteActionModal } from "@app/components/v2"; import { ProjectPermissionActions, ProjectPermissionSub, useProject, useSubscription } from "@app/context"; import { useDeleteTrustedIp } from "@app/hooks/api"; import { usePopUp } from "@app/hooks/usePopUp"; import { IPAllowlistModal } from "./IPAllowlistModal"; import { IPAllowlistTable } from "./IPAllowlistTable"; export const IPAllowlistSection = () => { const { mutateAsync } = useDeleteTrustedIp(); const { subscription } = useSubscription(); const { currentProject } = useProject(); const { popUp, handlePopUpOpen, handlePopUpClose, handlePopUpToggle } = usePopUp([ "trustedIp", "deleteTrustedIp", "upgradePlan" ] as const); const onDeleteTrustedIpSubmit = async (trustedIpId: string) => { try { if (!currentProject?.id) return; await mutateAsync({ projectId: currentProject.id, trustedIpId }); createNotification({ text: "Successfully deleted IP access range", type: "success" }); handlePopUpClose("deleteTrustedIp"); } catch (err) { console.log(err); createNotification({ text: "Failed to delete IP access range", type: "error" }); } }; return (