summaryrefslogtreecommitdiff
path: root/api/types.ts
blob: 424ccce5bfe3e9fb6582dfc2b44c65959cf9b4b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
export type OverallStatus = "all_clear" | "attention";

export type AlertSeverity = "gentle" | "needs_attention";

export type Alert = {
  id: string;
  title: string;
  timeLabel: string;
  whatHappened: string;
  whyItMatters: string;
  suggestedAction: string;
  severity: AlertSeverity;
};

export type HomeData = {
  overallStatus: OverallStatus;
  deviceOnline: boolean;
  alertStats: {
    last24Hours: number;
    thisWeekReviewed: number;
  };
};

export type ActivityMetric = {
  id: string;
  icon: "chatbubbles" | "people" | "time";
  title: string;
  description: string;
  level: "Normal" | "Low" | "High" | "Better" | "Worse";
};

export type ActivityData = {
  period: string;
  metrics: ActivityMetric[];
};

export type Device = {
  id: string;
  name: string;
  status: "online" | "offline";
  lastCheck: string;
};

export type SafetyControlValue = boolean | string;

export type SafetyControl = {
  key: string;
  title: string;
  description: string;
  defaultValue: SafetyControlValue;
};

export type ControlsData = {
  safetyControls: SafetyControl[];
};