1 import { useOrganization } from '@proton/account/organization/hooks';
2 import { useUser } from '@proton/account/user/hooks';
3 import { ZoomRow } from '@proton/calendar';
4 import type { EventModel } from '@proton/shared/lib/interfaces/calendar';
5 import { useFlag } from '@proton/unleash';
9 setModel: (value: EventModel) => void;
12 export const RowVideoConference = ({ model, setModel }: Props) => {
13 const [user] = useUser();
14 const [organization] = useOrganization();
15 const isZoomIntegrationEnabled = useFlag('ZoomIntegration');
16 const isSettingEnabled = organization?.Settings.VideoConferencingEnabled;
17 const hasFullZoomAccess = user.hasPaidMail && isSettingEnabled;
18 const hasLimitedZoomAccess = user.hasPaidMail && !isSettingEnabled;
19 const hasAccessToZoomIntegration =
20 isZoomIntegrationEnabled &&
21 // We want to upsell free Mail users or only display the feature for mail subscribers
22 (!user.hasPaidMail || hasFullZoomAccess || hasLimitedZoomAccess);
24 if (!hasAccessToZoomIntegration) {
28 const getAccessLevel = () => {
29 if (!user.hasPaidMail) {
32 return hasFullZoomAccess ? 'full-access' : 'limited-access';
35 return <ZoomRow model={model} setModel={setModel} accessLevel={getAccessLevel()} />;