diff --git a/apps/web/modules/videos/ai/ai-transcribe.tsx b/apps/web/modules/videos/ai/ai-transcribe.tsx index b30b8c2a4d..ce85280c74 100644 --- a/apps/web/modules/videos/ai/ai-transcribe.tsx +++ b/apps/web/modules/videos/ai/ai-transcribe.tsx @@ -6,7 +6,7 @@ import { Toaster } from "react-hot-toast"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { showToast } from "@calcom/ui"; -export const CalAiTransctibe = () => { +export const CalAiTranscribe = () => { const daily = useDaily(); const { t } = useLocale(); diff --git a/apps/web/modules/videos/views/videos-single-view.getServerSideProps.tsx b/apps/web/modules/videos/views/videos-single-view.getServerSideProps.tsx index b7b0e11241..6c28da1067 100644 --- a/apps/web/modules/videos/views/videos-single-view.getServerSideProps.tsx +++ b/apps/web/modules/videos/views/videos-single-view.getServerSideProps.tsx @@ -60,6 +60,19 @@ export async function getServerSideProps(context: GetServerSidePropsContext) { }; } + const hasTeamPlan = booking.user?.id + ? await prisma.membership.findFirst({ + where: { + userId: booking.user.id, + team: { + slug: { + not: null, + }, + }, + }, + }) + : false; + const profile = booking.user ? ( await UserRepository.enrichUserWithItsProfile({ @@ -114,6 +127,7 @@ export async function getServerSideProps(context: GetServerSidePropsContext) { } : bookingObj.user, }, + hasTeamPlan: !!hasTeamPlan, trpcState: ssr.dehydrate(), }, }; diff --git a/apps/web/modules/videos/views/videos-single-view.tsx b/apps/web/modules/videos/views/videos-single-view.tsx index a170b66fc2..df8979ff8c 100644 --- a/apps/web/modules/videos/views/videos-single-view.tsx +++ b/apps/web/modules/videos/views/videos-single-view.tsx @@ -14,13 +14,13 @@ import { useLocale } from "@calcom/lib/hooks/useLocale"; import { markdownToSafeHTML } from "@calcom/lib/markdownToSafeHTML"; import { Icon } from "@calcom/ui"; -import { CalAiTransctibe } from "~/videos/ai/ai-transcribe"; +import { CalAiTranscribe } from "~/videos/ai/ai-transcribe"; import { type PageProps } from "./videos-single-view.getServerSideProps"; export default function JoinCall(props: PageProps) { const { t } = useLocale(); - const { meetingUrl, meetingPassword, booking } = props; + const { meetingUrl, meetingPassword, booking, hasTeamPlan } = props; const [daily, setDaily] = useState(null); useEffect(() => { @@ -47,14 +47,16 @@ export default function JoinCall(props: PageProps) { }, url: meetingUrl, ...(typeof meetingPassword === "string" && { token: meetingPassword }), - customTrayButtons: { - transcription: { - label: "Cal.ai", - tooltip: "Toggle real time transcription powered by AI", - iconPath: `${WEBAPP_URL}/sparkles.svg`, - iconPathDarkMode: `${WEBAPP_URL}/sparkles.svg`, + ...(hasTeamPlan && { + customTrayButtons: { + transcription: { + label: "Cal.ai", + tooltip: "Toggle real time transcription powered by AI", + iconPath: `${WEBAPP_URL}/sparkles.svg`, + iconPathDarkMode: `${WEBAPP_URL}/sparkles.svg`, + }, }, - }, + }), }); setDaily(callFrame); @@ -86,7 +88,7 @@ export default function JoinCall(props: PageProps) {
- +
{booking?.user?.organization?.calVideoLogo ? ( diff --git a/packages/app-store/dailyvideo/lib/VideoApiAdapter.ts b/packages/app-store/dailyvideo/lib/VideoApiAdapter.ts index 3c75f49238..2bfd4bab7c 100644 --- a/packages/app-store/dailyvideo/lib/VideoApiAdapter.ts +++ b/packages/app-store/dailyvideo/lib/VideoApiAdapter.ts @@ -30,7 +30,7 @@ const dailyReturnTypeSchema = z.object({ enable_chat: z.boolean(), enable_knocking: z.boolean(), enable_prejoin_ui: z.boolean(), - enable_transcription_storage: z.boolean(), + enable_transcription_storage: z.boolean().default(false), }), }); @@ -179,9 +179,11 @@ const DailyVideoApiAdapter = (): VideoApiAdapter => { exp: exp, enable_recording: scalePlan === "true" && !!hasTeamPlan === true ? "cloud" : undefined, enable_transcription_storage: !!hasTeamPlan, - permissions: { - canAdmin: ["transcription"], - }, + ...(!!hasTeamPlan && { + permissions: { + canAdmin: ["transcription"], + }, + }), }, }; };