@nivaro/react 0.3.6 → 0.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,26 +1,26 @@
1
1
  import { jsxs as d, jsx as e } from "react/jsx-runtime";
2
- import { useQuery as _ } from "@tanstack/react-query";
3
- import { BarChart3 as $ } from "lucide-react";
2
+ import { useQuery as $ } from "@tanstack/react-query";
3
+ import { BarChart3 as M } from "lucide-react";
4
4
  import { useState as f } from "react";
5
- import { useNivaroClient as M } from "../../context.js";
6
- import { get as S } from "../../lib/commands.js";
7
- import { cn as p } from "../../lib/utils.js";
8
- import { QueryErrorState as C } from "../QueryErrorState.js";
9
- const o = (l) => `${Math.round(l * 100)}%`, y = (l) => l == null ? "—" : l < 60 ? `${Math.round(l)}m` : l < 1440 ? `${(l / 60).toFixed(1)}h` : `${(l / 1440).toFixed(1)}d`;
10
- function m({ label: l, value: n, hint: s }) {
5
+ import { useNivaroClient as S } from "../../context.js";
6
+ import { get as C } from "../../lib/commands.js";
7
+ import { cn as x } from "../../lib/utils.js";
8
+ import { QueryErrorState as L } from "../QueryErrorState.js";
9
+ const c = (l) => `${Math.round(l * 100)}%`, y = (l) => l == null ? "—" : l < 60 ? `${Math.round(l)}m` : l < 1440 ? `${(l / 60).toFixed(1)}h` : `${(l / 1440).toFixed(1)}d`;
10
+ function m({ label: l, value: s, hint: i }) {
11
11
  return /* @__PURE__ */ d("div", { className: "rounded-lg border border-slate-200 bg-white px-4 py-3 dark:border-border dark:bg-card", children: [
12
12
  /* @__PURE__ */ e("p", { className: "text-[12px] font-medium text-slate-500 dark:text-muted-foreground", children: l }),
13
- /* @__PURE__ */ e("p", { className: "mt-1 text-[22px] font-semibold tabular-nums text-slate-900 dark:text-foreground", children: n }),
14
- s && /* @__PURE__ */ e("p", { className: "text-[11px] text-slate-500 dark:text-muted-foreground", children: s })
13
+ /* @__PURE__ */ e("p", { className: "mt-1 text-[22px] font-semibold tabular-nums text-slate-900 dark:text-foreground", children: s }),
14
+ i && /* @__PURE__ */ e("p", { className: "text-[11px] text-slate-500 dark:text-muted-foreground", children: i })
15
15
  ] });
16
16
  }
17
- function x({ title: l, rows: n, keyLabel: s }) {
18
- const c = Math.max(1, ...n.map((t) => t.sent));
17
+ function h({ title: l, rows: s, keyLabel: i }) {
18
+ const o = Math.max(1, ...s.map((a) => a.sent));
19
19
  return /* @__PURE__ */ d("div", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
20
20
  /* @__PURE__ */ e("header", { className: "border-b border-slate-100 px-4 py-2.5 dark:border-border/60", children: /* @__PURE__ */ e("h3", { className: "text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: l }) }),
21
- n.length === 0 ? /* @__PURE__ */ e("p", { className: "px-4 py-4 text-[12px] text-slate-500 dark:text-muted-foreground", children: "Nothing in this window." }) : /* @__PURE__ */ d("table", { className: "w-full text-[12px] tabular-nums", children: [
21
+ s.length === 0 ? /* @__PURE__ */ e("p", { className: "px-4 py-4 text-[12px] text-slate-500 dark:text-muted-foreground", children: "Nothing in this window." }) : /* @__PURE__ */ d("table", { className: "w-full text-[12px] tabular-nums", children: [
22
22
  /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ d("tr", { className: "text-left text-[11px] text-slate-500 dark:text-muted-foreground", children: [
23
- /* @__PURE__ */ e("th", { className: "px-4 py-1.5 font-semibold", children: s }),
23
+ /* @__PURE__ */ e("th", { className: "px-4 py-1.5 font-semibold", children: i }),
24
24
  /* @__PURE__ */ e("th", { className: "px-2 py-1.5 text-right font-semibold", children: "Sent" }),
25
25
  /* @__PURE__ */ e("th", { className: "px-2 py-1.5 text-right font-semibold", children: "Read" }),
26
26
  /* @__PURE__ */ e("th", { className: "px-2 py-1.5 text-right font-semibold", children: "Time to read" }),
@@ -41,133 +41,152 @@ function x({ title: l, rows: n, keyLabel: s }) {
41
41
  }
42
42
  )
43
43
  ] }) }),
44
- /* @__PURE__ */ e("tbody", { children: n.map((t) => /* @__PURE__ */ d("tr", { className: "border-t border-slate-100 dark:border-border", children: [
44
+ /* @__PURE__ */ e("tbody", { children: s.map((a) => /* @__PURE__ */ d("tr", { className: "border-t border-slate-100 dark:border-border", children: [
45
45
  /* @__PURE__ */ e("td", { className: "px-4 py-1.5", children: /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
46
- /* @__PURE__ */ e("span", { className: "min-w-0 truncate text-slate-700 dark:text-foreground", children: t.label ?? t.key.replace(/_/g, " ") }),
46
+ /* @__PURE__ */ e("span", { className: "min-w-0 truncate text-slate-700 dark:text-foreground", children: a.label ?? a.key.replace(/_/g, " ") }),
47
47
  /* @__PURE__ */ e(
48
48
  "span",
49
49
  {
50
50
  className: "h-1.5 rounded-full bg-nvr-cyan/40",
51
- style: { width: `${Math.max(4, t.sent / c * 80)}px` }
51
+ style: { width: `${Math.max(4, a.sent / o * 80)}px` }
52
52
  }
53
53
  )
54
54
  ] }) }),
55
- /* @__PURE__ */ e("td", { className: "px-2 py-1.5 text-right text-slate-700 dark:text-foreground", children: t.sent }),
55
+ /* @__PURE__ */ e("td", { className: "px-2 py-1.5 text-right text-slate-700 dark:text-foreground", children: a.sent }),
56
56
  /* @__PURE__ */ e("td", { className: "px-2 py-1.5 text-right", children: /* @__PURE__ */ e(
57
57
  "span",
58
58
  {
59
- className: p(
60
- t.read_rate >= 0.6 ? "text-emerald-700 dark:text-emerald-400" : t.read_rate >= 0.3 ? "text-slate-700 dark:text-foreground" : "text-amber-700 dark:text-amber-400"
59
+ className: x(
60
+ a.read_rate >= 0.6 ? "text-emerald-700 dark:text-emerald-400" : a.read_rate >= 0.3 ? "text-slate-700 dark:text-foreground" : "text-amber-700 dark:text-amber-400"
61
61
  ),
62
- children: o(t.read_rate)
62
+ children: c(a.read_rate)
63
63
  }
64
64
  ) }),
65
- /* @__PURE__ */ e("td", { className: "px-2 py-1.5 text-right text-slate-500", children: y(t.median_minutes_to_read) }),
65
+ /* @__PURE__ */ e("td", { className: "px-2 py-1.5 text-right text-slate-500", children: y(a.median_minutes_to_read) }),
66
66
  /* @__PURE__ */ e(
67
67
  "td",
68
68
  {
69
69
  className: "px-2 py-1.5 text-right text-slate-700 dark:text-foreground",
70
- "data-tip": t.acted_eligible ? `${t.acted} of ${t.acted_eligible} record notifications` : "",
71
- children: t.acted_rate == null ? "—" : o(t.acted_rate)
70
+ "data-tip": a.acted_eligible ? `${a.acted} of ${a.acted_eligible} record notifications` : "",
71
+ children: a.acted_rate == null ? "—" : c(a.acted_rate)
72
72
  }
73
73
  ),
74
- /* @__PURE__ */ e("td", { className: "px-2 py-1.5 text-right", children: t.read_ignored_rate == null ? /* @__PURE__ */ e("span", { className: "text-slate-400", children: "—" }) : /* @__PURE__ */ e(
74
+ /* @__PURE__ */ e("td", { className: "px-2 py-1.5 text-right", children: a.read_ignored_rate == null ? /* @__PURE__ */ e("span", { className: "text-slate-400", children: "—" }) : /* @__PURE__ */ e(
75
75
  "span",
76
76
  {
77
- className: t.read_ignored_rate >= 0.5 ? "text-amber-700 dark:text-amber-400" : "text-slate-500",
78
- children: o(t.read_ignored_rate)
77
+ className: a.read_ignored_rate >= 0.5 ? "text-amber-700 dark:text-amber-400" : "text-slate-500",
78
+ children: c(a.read_ignored_rate)
79
79
  }
80
80
  ) })
81
- ] }, t.key)) })
81
+ ] }, a.key)) })
82
82
  ] })
83
83
  ] });
84
84
  }
85
- function h({ title: l, counts: n }) {
86
- const s = Object.entries(n).filter(([, t]) => t > 0), c = s.reduce((t, [, i]) => t + i, 0);
85
+ function p({ title: l, counts: s }) {
86
+ const i = Object.entries(s).filter(([, a]) => a > 0), o = i.reduce((a, [, n]) => a + n, 0);
87
87
  return /* @__PURE__ */ d("div", { className: "rounded-lg border border-slate-200 bg-white px-4 py-3 dark:border-border dark:bg-card", children: [
88
88
  /* @__PURE__ */ e("p", { className: "text-[12px] font-medium text-slate-500 dark:text-muted-foreground", children: l }),
89
- c === 0 ? /* @__PURE__ */ e("p", { className: "mt-1 text-[12px] text-slate-500 dark:text-muted-foreground", children: "No tracked deliveries yet." }) : /* @__PURE__ */ e("ul", { className: "mt-1 space-y-0.5 text-[12px]", children: s.sort((t, i) => i[1] - t[1]).map(([t, i]) => /* @__PURE__ */ d("li", { className: "flex items-center justify-between", children: [
90
- /* @__PURE__ */ e("span", { className: "text-slate-600 dark:text-muted-foreground", children: t.replace(/_/g, " ") }),
89
+ o === 0 ? /* @__PURE__ */ e("p", { className: "mt-1 text-[12px] text-slate-500 dark:text-muted-foreground", children: "No tracked deliveries yet." }) : /* @__PURE__ */ e("ul", { className: "mt-1 space-y-0.5 text-[12px]", children: i.sort((a, n) => n[1] - a[1]).map(([a, n]) => /* @__PURE__ */ d("li", { className: "flex items-center justify-between", children: [
90
+ /* @__PURE__ */ e("span", { className: "text-slate-600 dark:text-muted-foreground", children: a.replace(/_/g, " ") }),
91
91
  /* @__PURE__ */ d("span", { className: "tabular-nums text-slate-800 dark:text-foreground", children: [
92
- i,
93
- /* @__PURE__ */ e("span", { className: "ml-1 text-[10.5px] text-slate-500 dark:text-muted-foreground", children: o(i / c) })
92
+ n,
93
+ /* @__PURE__ */ e("span", { className: "ml-1 text-[10.5px] text-slate-500 dark:text-muted-foreground", children: c(n / o) })
94
94
  ] })
95
- ] }, t)) })
95
+ ] }, a)) })
96
96
  ] });
97
97
  }
98
- function H({ className: l }) {
98
+ function D({
99
+ className: l,
100
+ compactHeader: s = !1
101
+ }) {
99
102
  var g;
100
- const n = M(), [s, c] = f(30), [t, i] = f(24), { data: r, isLoading: N, isError: k, error: v, refetch: w } = _({
101
- queryKey: ["notification-analytics", s, t],
102
- queryFn: () => n.request(
103
- S("/notifications/analytics", { days: s, acted_hours: t })
104
- ).then((a) => a.data)
105
- }), u = (r == null ? void 0 : r.series) ?? [], b = Math.max(1, ...u.map((a) => a.sent));
106
- return /* @__PURE__ */ d("div", { className: p("flex flex-1 min-h-0 flex-col", l), "data-nvr-notification-analytics": !0, children: [
107
- /* @__PURE__ */ e("header", { className: "shrink-0 border-b border-slate-200 bg-white px-6 py-4 dark:border-border dark:bg-card", children: /* @__PURE__ */ d("div", { className: "flex items-center gap-2.5", children: [
108
- /* @__PURE__ */ e($, { className: "h-5 w-5 text-muted-foreground" }),
109
- /* @__PURE__ */ d("div", { children: [
110
- /* @__PURE__ */ e("h1", { className: "text-[17px] font-semibold text-slate-900 dark:text-foreground", children: "Notification analytics" }),
111
- /* @__PURE__ */ e("p", { className: "mt-0.5 text-[12.5px] text-slate-500 dark:text-muted-foreground", children: "Where the noise comes from and whether anyone reads it — by category, sender, collection and channel, plus what people have muted." })
112
- ] }),
113
- /* @__PURE__ */ e("span", { className: "flex-1" }),
114
- /* @__PURE__ */ e("div", { className: "inline-flex rounded-md border border-slate-200 p-0.5 dark:border-border", children: [7, 30, 90].map((a) => /* @__PURE__ */ d(
115
- "button",
116
- {
117
- type: "button",
118
- onClick: () => c(a),
119
- "aria-pressed": s === a,
120
- className: p(
121
- "rounded px-2.5 py-1 text-[12px] font-medium",
122
- s === a ? "bg-slate-900 text-white dark:bg-nvr-cyan dark:text-[#172940]" : "text-slate-600 hover:bg-slate-100 dark:text-muted-foreground dark:hover:bg-muted"
123
- ),
124
- children: [
125
- a,
126
- "d"
127
- ]
128
- },
129
- a
130
- )) }),
131
- /* @__PURE__ */ d(
132
- "div",
133
- {
134
- className: "inline-flex items-center rounded-md border border-slate-200 p-0.5 dark:border-border",
135
- "data-tip": "How long after a notification an action still counts as acted",
136
- children: [
137
- /* @__PURE__ */ e("span", { className: "px-2 text-[12px] text-slate-500 dark:text-muted-foreground", children: "Acted within" }),
138
- [4, 24, 72].map((a) => /* @__PURE__ */ d(
139
- "button",
103
+ const i = S(), [o, a] = f(30), [n, N] = f(24), { data: r, isLoading: k, isError: v, error: w, refetch: _ } = $({
104
+ queryKey: ["notification-analytics", o, n],
105
+ queryFn: () => i.request(
106
+ C("/notifications/analytics", { days: o, acted_hours: n })
107
+ ).then((t) => t.data)
108
+ }), u = (r == null ? void 0 : r.series) ?? [], b = Math.max(1, ...u.map((t) => t.sent));
109
+ return /* @__PURE__ */ d("div", { className: x("flex flex-1 min-h-0 flex-col", l), "data-nvr-notification-analytics": !0, children: [
110
+ /* @__PURE__ */ e(
111
+ "header",
112
+ {
113
+ className: x(
114
+ s ? "flex min-h-16 shrink-0 flex-col justify-center border-b border-slate-200 bg-white px-4 py-3 sm:px-6 dark:border-border dark:bg-card" : "shrink-0 border-b border-slate-200 bg-white px-6 py-4 dark:border-border dark:bg-card"
115
+ ),
116
+ children: /* @__PURE__ */ d("div", { className: "flex items-center gap-2.5", children: [
117
+ !s && /* @__PURE__ */ e(M, { className: "h-5 w-5 text-muted-foreground" }),
118
+ /* @__PURE__ */ d("div", { children: [
119
+ !s && /* @__PURE__ */ e("h1", { className: "text-[17px] font-semibold text-slate-900 dark:text-foreground", children: "Notification analytics" }),
120
+ /* @__PURE__ */ e(
121
+ "p",
140
122
  {
141
- type: "button",
142
- onClick: () => i(a),
143
- "aria-pressed": t === a,
144
- "aria-label": `Acted within ${a} hours`,
145
- className: p(
146
- "rounded px-2.5 py-1 text-[12px] font-medium",
147
- t === a ? "bg-slate-900 text-white dark:bg-nvr-cyan dark:text-[#172940]" : "text-slate-600 hover:bg-slate-100 dark:text-muted-foreground dark:hover:bg-muted"
123
+ className: x(
124
+ s ? "m-0 max-w-[72ch] text-[12px] leading-relaxed text-slate-600 dark:text-muted-foreground" : "mt-0.5 text-[12.5px] text-slate-500 dark:text-muted-foreground"
148
125
  ),
149
- children: [
150
- a,
151
- "h"
152
- ]
153
- },
154
- a
155
- ))
156
- ]
157
- }
158
- )
159
- ] }) }),
160
- /* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto bg-slate-50 p-6 dark:bg-background", children: k && !r ? /* @__PURE__ */ e(
161
- C,
126
+ children: "Where the noise comes from and whether anyone reads it — by category, sender, collection and channel, plus what people have muted."
127
+ }
128
+ )
129
+ ] }),
130
+ /* @__PURE__ */ e("span", { className: "flex-1" }),
131
+ /* @__PURE__ */ e("div", { className: "inline-flex rounded-md border border-slate-200 p-0.5 dark:border-border", children: [7, 30, 90].map((t) => /* @__PURE__ */ d(
132
+ "button",
133
+ {
134
+ type: "button",
135
+ onClick: () => a(t),
136
+ "aria-pressed": o === t,
137
+ className: x(
138
+ "rounded px-2.5 py-1 text-[12px] font-medium",
139
+ o === t ? "bg-slate-900 text-white dark:bg-nvr-cyan dark:text-[#172940]" : "text-slate-600 hover:bg-slate-100 dark:text-muted-foreground dark:hover:bg-muted"
140
+ ),
141
+ children: [
142
+ t,
143
+ "d"
144
+ ]
145
+ },
146
+ t
147
+ )) }),
148
+ /* @__PURE__ */ d(
149
+ "div",
150
+ {
151
+ className: "inline-flex items-center rounded-md border border-slate-200 p-0.5 dark:border-border",
152
+ "data-tip": "How long after a notification an action still counts as acted",
153
+ children: [
154
+ /* @__PURE__ */ e("span", { className: "px-2 text-[12px] text-slate-500 dark:text-muted-foreground", children: "Acted within" }),
155
+ [4, 24, 72].map((t) => /* @__PURE__ */ d(
156
+ "button",
157
+ {
158
+ type: "button",
159
+ onClick: () => N(t),
160
+ "aria-pressed": n === t,
161
+ "aria-label": `Acted within ${t} hours`,
162
+ className: x(
163
+ "rounded px-2.5 py-1 text-[12px] font-medium",
164
+ n === t ? "bg-slate-900 text-white dark:bg-nvr-cyan dark:text-[#172940]" : "text-slate-600 hover:bg-slate-100 dark:text-muted-foreground dark:hover:bg-muted"
165
+ ),
166
+ children: [
167
+ t,
168
+ "h"
169
+ ]
170
+ },
171
+ t
172
+ ))
173
+ ]
174
+ }
175
+ )
176
+ ] })
177
+ }
178
+ ),
179
+ /* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto bg-slate-50 p-6 dark:bg-background", children: v && !r ? /* @__PURE__ */ e(
180
+ L,
162
181
  {
163
- error: v,
182
+ error: w,
164
183
  what: "notification analytics",
165
- onRetry: () => void w()
184
+ onRetry: () => void _()
166
185
  }
167
- ) : N || !r ? /* @__PURE__ */ e("p", { className: "text-[13px] text-slate-500 dark:text-muted-foreground", children: "Loading…" }) : /* @__PURE__ */ d("div", { className: "space-y-5", children: [
186
+ ) : k || !r ? /* @__PURE__ */ e("p", { className: "text-[13px] text-slate-500 dark:text-muted-foreground", children: "Loading…" }) : /* @__PURE__ */ d("div", { className: "space-y-5", children: [
168
187
  /* @__PURE__ */ d("div", { className: "grid grid-cols-2 gap-3 md:grid-cols-5", children: [
169
188
  /* @__PURE__ */ e(m, { label: "Sent", value: String(r.total), hint: `last ${r.days} days` }),
170
- /* @__PURE__ */ e(m, { label: "Read rate", value: o(r.read_rate), hint: `${r.read} read` }),
189
+ /* @__PURE__ */ e(m, { label: "Read rate", value: c(r.read_rate), hint: `${r.read} read` }),
171
190
  /* @__PURE__ */ e(
172
191
  m,
173
192
  {
@@ -179,8 +198,8 @@ function H({ className: l }) {
179
198
  /* @__PURE__ */ e(
180
199
  m,
181
200
  {
182
- label: `Acted within ${t}h`,
183
- value: ((g = r.acted) == null ? void 0 : g.acted_rate) == null ? "—" : o(r.acted.acted_rate),
201
+ label: `Acted within ${n}h`,
202
+ value: ((g = r.acted) == null ? void 0 : g.acted_rate) == null ? "—" : c(r.acted.acted_rate),
184
203
  hint: r.acted ? `${r.acted.acted} of ${r.acted.acted_eligible} record notifications` : void 0
185
204
  }
186
205
  ),
@@ -197,40 +216,40 @@ function H({ className: l }) {
197
216
  /* @__PURE__ */ d("div", { className: "rounded-lg border border-slate-200 bg-white px-4 py-3 dark:border-border dark:bg-card", children: [
198
217
  /* @__PURE__ */ e("p", { className: "text-[12px] font-medium text-slate-500 dark:text-muted-foreground", children: "Per day · sent (bar) and read (filled)" }),
199
218
  /* @__PURE__ */ d("div", { className: "mt-2 flex h-24 items-end gap-px", children: [
200
- u.map((a) => /* @__PURE__ */ d(
219
+ u.map((t) => /* @__PURE__ */ d(
201
220
  "div",
202
221
  {
203
222
  className: "relative flex-1",
204
- "data-tip": `${a.day}: ${a.sent} sent, ${a.read} read`,
205
- title: `${a.day}: ${a.sent} sent, ${a.read} read`,
223
+ "data-tip": `${t.day}: ${t.sent} sent, ${t.read} read`,
224
+ title: `${t.day}: ${t.sent} sent, ${t.read} read`,
206
225
  children: [
207
226
  /* @__PURE__ */ e(
208
227
  "div",
209
228
  {
210
229
  className: "w-full rounded-t-sm bg-nvr-cyan/25",
211
- style: { height: `${a.sent / b * 96}px` }
230
+ style: { height: `${t.sent / b * 96}px` }
212
231
  }
213
232
  ),
214
233
  /* @__PURE__ */ e(
215
234
  "div",
216
235
  {
217
236
  className: "absolute bottom-0 w-full rounded-t-sm bg-nvr-cyan",
218
- style: { height: `${a.read / b * 96}px` }
237
+ style: { height: `${t.read / b * 96}px` }
219
238
  }
220
239
  )
221
240
  ]
222
241
  },
223
- a.day
242
+ t.day
224
243
  )),
225
244
  u.length === 0 && /* @__PURE__ */ e("p", { className: "text-[12px] text-slate-500 dark:text-muted-foreground", children: "No notifications in this window." })
226
245
  ] })
227
246
  ] }),
228
247
  /* @__PURE__ */ d("div", { className: "grid grid-cols-1 gap-4 lg:grid-cols-2", children: [
229
- /* @__PURE__ */ e(x, { title: "By category", rows: r.by_category, keyLabel: "Category" }),
230
- /* @__PURE__ */ e(x, { title: "By sender", rows: r.by_sender, keyLabel: "Sender" }),
231
- /* @__PURE__ */ e(x, { title: "By lane", rows: r.by_lane, keyLabel: "Lane" }),
232
- /* @__PURE__ */ e(x, { title: "By kind", rows: r.by_kind, keyLabel: "Kind" }),
233
- /* @__PURE__ */ e(x, { title: "By collection", rows: r.by_collection, keyLabel: "Collection" }),
248
+ /* @__PURE__ */ e(h, { title: "By category", rows: r.by_category, keyLabel: "Category" }),
249
+ /* @__PURE__ */ e(h, { title: "By sender", rows: r.by_sender, keyLabel: "Sender" }),
250
+ /* @__PURE__ */ e(h, { title: "By lane", rows: r.by_lane, keyLabel: "Lane" }),
251
+ /* @__PURE__ */ e(h, { title: "By kind", rows: r.by_kind, keyLabel: "Kind" }),
252
+ /* @__PURE__ */ e(h, { title: "By collection", rows: r.by_collection, keyLabel: "Collection" }),
234
253
  /* @__PURE__ */ d("div", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
235
254
  /* @__PURE__ */ d("header", { className: "border-b border-slate-100 px-4 py-2.5 dark:border-border/60", children: [
236
255
  /* @__PURE__ */ e("h3", { className: "text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: "Most muted sources" }),
@@ -243,31 +262,31 @@ function H({ className: l }) {
243
262
  /* @__PURE__ */ e("th", { className: "px-2 py-1.5 text-right font-semibold", children: "Sent" }),
244
263
  /* @__PURE__ */ e("th", { className: "px-2 py-1.5 text-right font-semibold", children: "Mute rate" })
245
264
  ] }) }),
246
- /* @__PURE__ */ e("tbody", { children: r.mutes.top.map((a) => /* @__PURE__ */ d(
265
+ /* @__PURE__ */ e("tbody", { children: r.mutes.top.map((t) => /* @__PURE__ */ d(
247
266
  "tr",
248
267
  {
249
268
  className: "border-t border-slate-100 dark:border-border",
250
269
  children: [
251
- /* @__PURE__ */ e("td", { className: "px-4 py-1.5 text-slate-700 dark:text-foreground", children: a.collection.replace(/_/g, " ") }),
252
- /* @__PURE__ */ e("td", { className: "px-2 py-1.5 text-right", children: a.mutes }),
253
- /* @__PURE__ */ e("td", { className: "px-2 py-1.5 text-right text-slate-500", children: a.sent }),
254
- /* @__PURE__ */ e("td", { className: "px-2 py-1.5 text-right text-amber-700 dark:text-amber-400", children: a.sent ? o(a.mute_rate) : "—" })
270
+ /* @__PURE__ */ e("td", { className: "px-4 py-1.5 text-slate-700 dark:text-foreground", children: t.collection.replace(/_/g, " ") }),
271
+ /* @__PURE__ */ e("td", { className: "px-2 py-1.5 text-right", children: t.mutes }),
272
+ /* @__PURE__ */ e("td", { className: "px-2 py-1.5 text-right text-slate-500", children: t.sent }),
273
+ /* @__PURE__ */ e("td", { className: "px-2 py-1.5 text-right text-amber-700 dark:text-amber-400", children: t.sent ? c(t.mute_rate) : "—" })
255
274
  ]
256
275
  },
257
- a.collection
276
+ t.collection
258
277
  )) })
259
278
  ] })
260
279
  ] })
261
280
  ] }),
262
281
  /* @__PURE__ */ d("div", { className: "grid grid-cols-2 gap-3 md:grid-cols-4", children: [
263
- /* @__PURE__ */ e(h, { title: "In-app", counts: r.channels.inapp }),
264
- /* @__PURE__ */ e(h, { title: "Push", counts: r.channels.push }),
265
- /* @__PURE__ */ e(h, { title: "Email", counts: r.channels.email }),
266
- /* @__PURE__ */ e(h, { title: "SMS", counts: r.channels.sms })
282
+ /* @__PURE__ */ e(p, { title: "In-app", counts: r.channels.inapp }),
283
+ /* @__PURE__ */ e(p, { title: "Push", counts: r.channels.push }),
284
+ /* @__PURE__ */ e(p, { title: "Email", counts: r.channels.email }),
285
+ /* @__PURE__ */ e(p, { title: "SMS", counts: r.channels.sms })
267
286
  ] })
268
287
  ] }) })
269
288
  ] });
270
289
  }
271
290
  export {
272
- H as NotificationAnalyticsView
291
+ D as NotificationAnalyticsView
273
292
  };
@@ -1,18 +1,44 @@
1
1
  import { jsxs as r, jsx as e } from "react/jsx-runtime";
2
- import { BellRing as o } from "lucide-react";
3
- import { NotificationSourcesCard as a } from "../NotificationSourcesCard.js";
4
- function l({ title: t = "My Subscriptions" }) {
2
+ import { BellRing as d } from "lucide-react";
3
+ import { cn as s } from "../../lib/utils.js";
4
+ import { NotificationSourcesCard as i } from "../NotificationSourcesCard.js";
5
+ function x({
6
+ title: o = "My Subscriptions",
7
+ compactHeader: t = !1
8
+ }) {
9
+ const a = "What you are told about and how it reaches you — workflow states, records, queues.";
5
10
  return /* @__PURE__ */ r("div", { className: "flex min-h-0 flex-1 flex-col", "data-notification-subscriptions-view": !0, children: [
6
- /* @__PURE__ */ r("header", { className: "flex shrink-0 items-center gap-2.5 border-b border-slate-200 bg-white px-6 py-4 dark:border-border dark:bg-card", children: [
7
- /* @__PURE__ */ e(o, { className: "h-5 w-5 text-nvr-cyan" }),
11
+ t ? /* @__PURE__ */ e(
12
+ "header",
13
+ {
14
+ className: "flex min-h-16 shrink-0 flex-col justify-center border-b border-slate-200 bg-white px-4 py-3 sm:px-6 dark:border-border dark:bg-card",
15
+ children: /* @__PURE__ */ e(
16
+ "p",
17
+ {
18
+ className: "m-0 max-w-[72ch] text-[12px] leading-relaxed text-slate-600 dark:text-muted-foreground",
19
+ children: a
20
+ }
21
+ )
22
+ }
23
+ ) : /* @__PURE__ */ r("header", { className: "flex shrink-0 items-center gap-2.5 border-b border-slate-200 bg-white px-6 py-4 dark:border-border dark:bg-card", children: [
24
+ /* @__PURE__ */ e(d, { className: "h-5 w-5 text-nvr-cyan" }),
8
25
  /* @__PURE__ */ r("div", { children: [
9
- /* @__PURE__ */ e("h1", { className: "text-[17px] font-semibold text-slate-900 dark:text-foreground", children: t }),
10
- /* @__PURE__ */ e("p", { className: "mt-0.5 text-[12.5px] text-slate-500 dark:text-muted-foreground", children: "What you are told about and how it reaches you — workflow states, records, queues." })
26
+ /* @__PURE__ */ e("h1", { className: "text-[17px] font-semibold text-slate-900 dark:text-foreground", children: o }),
27
+ /* @__PURE__ */ e("p", { className: "mt-0.5 text-[12.5px] text-slate-500 dark:text-muted-foreground", children: a })
11
28
  ] })
12
29
  ] }),
13
- /* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto bg-slate-50 p-6 dark:bg-background", children: /* @__PURE__ */ e("div", { className: "rounded-xl border border-slate-200 bg-white dark:border-border dark:bg-card", children: /* @__PURE__ */ e(a, { only: "subscriptions", bare: !0 }) }) })
30
+ /* @__PURE__ */ e(
31
+ "div",
32
+ {
33
+ className: s(
34
+ "flex-1 overflow-y-auto bg-slate-50 dark:bg-background",
35
+ t ? "p-4 sm:p-6" : "p-6"
36
+ ),
37
+ children: /* @__PURE__ */ e("div", { className: "rounded-xl border border-slate-200 bg-white dark:border-border dark:bg-card", children: /* @__PURE__ */ e(i, { only: "subscriptions", bare: !0 }) })
38
+ }
39
+ )
14
40
  ] });
15
41
  }
16
42
  export {
17
- l as NotificationSubscriptionsView
43
+ x as NotificationSubscriptionsView
18
44
  };