Use same lock values as mobile clients
[ProtonMail-WebClient.git] / packages / shared / lib / helpers / collapsibleSidebar.ts
blob208eaff19a28afd0a5ba515fe97843201ad7ef03
1 import { TelemetryCollapsibleLeftSidebarEvents, TelemetryMeasurementGroups } from '@proton/shared/lib/api/telemetry';
2 import { sendTelemetryReport } from '@proton/shared/lib/helpers/metrics';
4 import type { APP_NAMES } from '../constants';
5 import type { Api } from '../interfaces';
7 export const enum COLLAPSE_EVENTS {
8     COLLAPSE = 'COLLAPSE',
9     EXPAND = 'EXPAND',
11 export const enum SOURCE_EVENT {
12     BUTTON_SIDEBAR = 'BUTTON_SIDEBAR',
13     BUTTON_FOLDERS = 'BUTTON_FOLDERS',
14     BUTTON_LABELS = 'BUTTON_LABELS',
17 export const sendRequestCollapsibleSidebarReport = ({
18     api,
19     action,
20     application,
21     sourceEvent,
22 }: {
23     api: Api;
24     action: COLLAPSE_EVENTS;
25     application: APP_NAMES;
26     sourceEvent: SOURCE_EVENT;
27 }) => {
28     void sendTelemetryReport({
29         api,
30         measurementGroup: TelemetryMeasurementGroups.collapsibleLeftSidebar,
31         event: TelemetryCollapsibleLeftSidebarEvents.toggleLeftSidebar,
32         dimensions: {
33             action,
34             application,
35             sourceEvent,
36         },
37     });