import { useState } from "react"; import ConnectionInfo from "@calcom/ee/sso/components/ConnectionInfo"; import LicenseRequired from "@calcom/features/ee/common/components/v2/LicenseRequired"; import OIDCConnection from "@calcom/features/ee/sso/components/OIDCConnection"; import SAMLConnection from "@calcom/features/ee/sso/components/SAMLConnection"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { trpc } from "@calcom/trpc/react"; import { AppSkeletonLoader as SkeletonLoader, Meta, Alert } from "@calcom/ui"; export default function SSOConfiguration({ teamId }: { teamId: number | null }) { const [errorMessage, setErrorMessage] = useState(""); const { t } = useLocale(); const { data: connection, isLoading } = trpc.viewer.saml.get.useQuery( { teamId }, { onError: (err) => { setErrorMessage(err.message); }, } ); if (isLoading) { return ; } if (errorMessage) { return ( <> > ); } // No connection found if (!connection) { return ( ); } return ( {connection.type === "saml" ? ( ) : ( )} ); }