import { Controller, useForm } from "react-hook-form"; import LicenseRequired from "@calcom/ee/common/components/v2/LicenseRequired"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { collectPageParameters, telemetryEventTypes, useTelemetry } from "@calcom/lib/telemetry"; import { trpc } from "@calcom/trpc/react"; import { DialogFooter } from "@calcom/ui/Dialog"; import { Button } from "@calcom/ui/components/button"; import { Form, TextArea } from "@calcom/ui/components/form"; import { showToast } from "@calcom/ui/v2"; interface TeamSSOValues { metadata: string; } export default function ConfigDialogForm({ teamId, handleClose, }: { teamId: number | null; handleClose: () => void; }) { const { t } = useLocale(); const utils = trpc.useContext(); const telemetry = useTelemetry(); const form = useForm(); const mutation = trpc.useMutation("viewer.saml.update", { async onSuccess() { telemetry.event(telemetryEventTypes.samlConfig, collectPageParameters()); await utils.invalidateQueries(["viewer.saml.get"]); showToast(t("saml_config_updated_successfully"), "success"); handleClose(); }, onError: (err) => { showToast(err.message, "error"); }, }); return (
{ mutation.mutate({ teamId, encodedRawMetadata: Buffer.from(values.metadata).toString("base64"), }); }}>

{t("saml_configuration")}

{t("saml_configuration_description")}

(