"use client"; import { CheckIcon, Trash2Icon } from "lucide-react"; import { useState } from "react"; import { deleteSamlConfig } from "@/actions/integrations"; import { Button } from "@/components/shadcn"; import { Modal } from "@/components/shadcn/modal"; import { useToast } from "@/components/ui"; import { CustomLink } from "@/components/ui/custom/custom-link"; import { Card, CardContent, CardHeader } from "../../shadcn"; import { SamlConfigForm } from "./saml-config-form"; export const SamlIntegrationCard = ({ samlConfig }: { samlConfig?: any }) => { const [isSamlModalOpen, setIsSamlModalOpen] = useState(false); const [isDeleteModalOpen, setIsDeleteModalOpen] = useState(false); const [isDeleting, setIsDeleting] = useState(false); const { toast } = useToast(); const id = samlConfig?.id; const handleRemoveSaml = async () => { if (!id) return; setIsDeleting(true); try { const result = await deleteSamlConfig(id); if (result.success) { toast({ title: "SAML configuration removed", description: result.success, }); setIsDeleteModalOpen(false); } else if (result.errors?.general) { toast({ variant: "destructive", title: "Error removing SAML configuration", description: result.errors.general, }); } } catch { toast({ variant: "destructive", title: "Error", description: "Failed to remove SAML configuration. Please try again.", }); } finally { setIsDeleting(false); } }; return ( <> {/* Configure SAML Modal */} {/* Delete Confirmation Modal */}

Are you sure you want to remove the SAML SSO configuration? Users will no longer be able to sign in using SAML.

SAML SSO Integration

{id && }

{id ? ( "SAML Single Sign-On is enabled for this organization" ) : ( <> Configure SAML Single Sign-On for secure authentication.{" "} Read the docs )}

Status: {id ? "Enabled" : "Disabled"}
{id && ( )}
); };