import { PlusIcon } from "@heroicons/react/solid"; import { MembershipRole } from "@prisma/client"; import { useRouter } from "next/router"; import { useEffect, useState } from "react"; import SAMLConfiguration from "@ee/components/saml/Configuration"; import { getPlaceholderAvatar } from "@lib/getPlaceholderAvatar"; import { useLocale } from "@lib/hooks/useLocale"; import showToast from "@lib/notification"; import { trpc } from "@lib/trpc"; import Loader from "@components/Loader"; import Shell from "@components/Shell"; import MemberInvitationModal from "@components/team/MemberInvitationModal"; import MemberList from "@components/team/MemberList"; import TeamSettings from "@components/team/TeamSettings"; import TeamSettingsRightSidebar from "@components/team/TeamSettingsRightSidebar"; import { UpgradeToFlexibleProModal } from "@components/team/UpgradeToFlexibleProModal"; import { Alert } from "@components/ui/Alert"; import Avatar from "@components/ui/Avatar"; import { Button } from "@components/ui/Button"; export function TeamSettingsPage() { const { t } = useLocale(); const router = useRouter(); const upgraded = router.query.upgraded as string; useEffect(() => { if (upgraded) { showToast(t("team_upgraded_successfully"), "success"); } // eslint-disable-next-line react-hooks/exhaustive-deps }, []); const [showMemberInvitationModal, setShowMemberInvitationModal] = useState(false); const [errorMessage, setErrorMessage] = useState(""); const { data: team, isLoading } = trpc.useQuery(["viewer.teams.get", { teamId: Number(router.query.id) }], { onError: (e) => { setErrorMessage(e.message); }, }); const isAdmin = team && (team.membership.role === MembershipRole.OWNER || team.membership.role === MembershipRole.ADMIN); return ( ) }> {!!errorMessage && } {isLoading && } {team && ( <>
{team.membership.role === MembershipRole.OWNER && team.membership.isMissingSeat && team.requiresUpgrade ? ( {t("hidden_team_owner_message")} {/* {"https://cal.com/upgrade"} */} } className="mb-4 " /> ) : ( <> {team.membership.isMissingSeat && ( )} {team.membership.role === MembershipRole.OWNER && team.requiresUpgrade && ( {t("upgrade_to_flexible_pro_message")}
} className="mb-4" /> )} )}
{isAdmin ? ( ) : (
{t("team_info")}

{team.bio}

)}

{t("members")}

{isAdmin && (
)}
{isAdmin && }
{showMemberInvitationModal && ( setShowMemberInvitationModal(false)} /> )} )}
); } export default TeamSettingsPage;