import { faPlus } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { createNotification } from "@app/components/notifications"; import { ProjectPermissionCan } from "@app/components/permissions"; import { Button, DeleteActionModal } from "@app/components/v2"; import { ProjectPermissionActions, ProjectPermissionSub, useProject } from "@app/context"; import { useDeletePkiCollection } from "@app/hooks/api"; import { usePopUp } from "@app/hooks/usePopUp"; import { PkiCollectionModal } from "./PkiCollectionModal"; import { PkiCollectionTable } from "./PkiCollectionTable"; export const PkiCollectionSection = () => { const { currentProject } = useProject(); const projectId = currentProject?.id || ""; const { mutateAsync: deletePkiCollection } = useDeletePkiCollection(); const { popUp, handlePopUpOpen, handlePopUpClose, handlePopUpToggle } = usePopUp([ "pkiCollection", "deletePkiCollection" ] as const); const onRemovePkiCollectionSubmit = async (collectionId: string) => { try { if (!projectId) return; await deletePkiCollection({ collectionId, projectId }); createNotification({ text: "Successfully deleted PKI collection", type: "success" }); handlePopUpClose("deletePkiCollection"); } catch (err) { console.error(err); createNotification({ text: "Failed to delete PKI collection", type: "error" }); } }; return (
Certificate Collections