1 import type { Organization, User, UserModel } from '../interfaces';
2 import { openNewTab } from './browser';
3 import { hasPhoneSupport } from './organization';
5 export const canScheduleOrganizationPhoneCalls = ({
9 organization: Organization | undefined;
13 * User is admin of an org check
15 if (user.isFree || !organization || !user.isAdmin) {
20 * Admin panel flag check
22 return hasPhoneSupport(organization);
25 export const openCalendlyLink = (calendlyLink: string, user: User) => {
26 const params = new URLSearchParams({
27 name: user.DisplayName,
30 * a1 autofills the first custom element in the calendly form
35 openNewTab(`${calendlyLink}?${params.toString()}`);