Use same lock values as mobile clients
[ProtonMail-WebClient.git] / packages / shared / lib / helpers / support.ts
blob39340398c3fb0c2169b81ccab88e9a76e936174f
1 import type { Organization, User, UserModel } from '../interfaces';
2 import { openNewTab } from './browser';
3 import { hasPhoneSupport } from './organization';
5 export const canScheduleOrganizationPhoneCalls = ({
6     organization,
7     user,
8 }: {
9     organization: Organization | undefined;
10     user: UserModel;
11 }) => {
12     /**
13      * User is admin of an org check
14      */
15     if (user.isFree || !organization || !user.isAdmin) {
16         return false;
17     }
19     /**
20      * Admin panel flag check
21      */
22     return hasPhoneSupport(organization);
25 export const openCalendlyLink = (calendlyLink: string, user: User) => {
26     const params = new URLSearchParams({
27         name: user.DisplayName,
28         email: user.Email,
29         /**
30          * a1 autofills the first custom element in the calendly form
31          */
32         a1: user.Name,
33     });
35     openNewTab(`${calendlyLink}?${params.toString()}`);