@nivaro/react 0.3.7 → 0.3.9
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.
- package/dist/full.css +1 -1
- package/dist/hooks/replayUploadQueue.js +107 -93
- package/dist/hooks/useSessionRecorder.js +103 -101
- package/dist/index.d.ts +62 -4
- package/dist/index.js +300 -292
- package/dist/shared/components/CollectionBrowserView.js +318 -318
- package/dist/shared/components/DataTable.js +230 -223
- package/dist/shared/components/ForceReloadBanner.js +31 -26
- package/dist/shared/components/QueryTable.js +49 -49
- package/dist/shared/components/chat/ChatPanel.js +290 -287
- package/dist/shared/components/chat/chat-core.js +55 -48
- package/dist/shared/components/delegation/DelegationConsoleView.js +294 -167
- package/dist/shared/components/notifications/NotificationAnalyticsView.js +143 -124
- package/dist/shared/components/notifications/NotificationSubscriptionsView.js +35 -9
- package/dist/shared/components/panels/CommentPanel.js +237 -236
- package/dist/shared/components/profile/usePersonPresence.js +42 -37
- package/dist/shared/lib/presence-live.js +54 -0
- package/dist/shared/lib/presence-state.js +39 -31
- package/dist/shared/lib/request-gate.js +120 -102
- package/dist/shared/lib/rum.js +45 -36
- package/dist/shared/lib/signed-out.js +114 -0
- package/dist/shared/lib/socket-realtime.js +19 -17
- package/dist/shared/lib/use-online-users.js +11 -10
- package/dist/shared/lib/worker-socket.js +89 -79
- package/package.json +1 -1
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { jsxs as d, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { useQuery as
|
|
3
|
-
import { BarChart3 as
|
|
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
|
|
6
|
-
import { get as
|
|
7
|
-
import { cn as
|
|
8
|
-
import { QueryErrorState as
|
|
9
|
-
const
|
|
10
|
-
function m({ label: l, value:
|
|
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:
|
|
14
|
-
|
|
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
|
|
18
|
-
const
|
|
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
|
-
|
|
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:
|
|
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:
|
|
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:
|
|
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,
|
|
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:
|
|
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:
|
|
60
|
-
|
|
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:
|
|
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(
|
|
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":
|
|
71
|
-
children:
|
|
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:
|
|
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:
|
|
78
|
-
children:
|
|
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
|
-
] },
|
|
81
|
+
] }, a.key)) })
|
|
82
82
|
] })
|
|
83
83
|
] });
|
|
84
84
|
}
|
|
85
|
-
function
|
|
86
|
-
const
|
|
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
|
-
|
|
90
|
-
/* @__PURE__ */ e("span", { className: "text-slate-600 dark:text-muted-foreground", children:
|
|
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
|
-
|
|
93
|
-
/* @__PURE__ */ e("span", { className: "ml-1 text-[10.5px] text-slate-500 dark:text-muted-foreground", children:
|
|
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
|
-
] },
|
|
95
|
+
] }, a)) })
|
|
96
96
|
] });
|
|
97
97
|
}
|
|
98
|
-
function
|
|
98
|
+
function D({
|
|
99
|
+
className: l,
|
|
100
|
+
compactHeader: s = !1
|
|
101
|
+
}) {
|
|
99
102
|
var g;
|
|
100
|
-
const
|
|
101
|
-
queryKey: ["notification-analytics",
|
|
102
|
-
queryFn: () =>
|
|
103
|
-
|
|
104
|
-
).then((
|
|
105
|
-
}), u = (r == null ? void 0 : r.series) ?? [], b = Math.max(1, ...u.map((
|
|
106
|
-
return /* @__PURE__ */ d("div", { className:
|
|
107
|
-
/* @__PURE__ */ e(
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
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
|
-
|
|
142
|
-
|
|
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
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
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:
|
|
182
|
+
error: w,
|
|
164
183
|
what: "notification analytics",
|
|
165
|
-
onRetry: () => void
|
|
184
|
+
onRetry: () => void _()
|
|
166
185
|
}
|
|
167
|
-
) :
|
|
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:
|
|
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 ${
|
|
183
|
-
value: ((g = r.acted) == null ? void 0 : g.acted_rate) == null ? "—" :
|
|
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((
|
|
219
|
+
u.map((t) => /* @__PURE__ */ d(
|
|
201
220
|
"div",
|
|
202
221
|
{
|
|
203
222
|
className: "relative flex-1",
|
|
204
|
-
"data-tip": `${
|
|
205
|
-
title: `${
|
|
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: `${
|
|
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: `${
|
|
237
|
+
style: { height: `${t.read / b * 96}px` }
|
|
219
238
|
}
|
|
220
239
|
)
|
|
221
240
|
]
|
|
222
241
|
},
|
|
223
|
-
|
|
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(
|
|
230
|
-
/* @__PURE__ */ e(
|
|
231
|
-
/* @__PURE__ */ e(
|
|
232
|
-
/* @__PURE__ */ e(
|
|
233
|
-
/* @__PURE__ */ e(
|
|
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((
|
|
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:
|
|
252
|
-
/* @__PURE__ */ e("td", { className: "px-2 py-1.5 text-right", children:
|
|
253
|
-
/* @__PURE__ */ e("td", { className: "px-2 py-1.5 text-right text-slate-500", children:
|
|
254
|
-
/* @__PURE__ */ e("td", { className: "px-2 py-1.5 text-right text-amber-700 dark:text-amber-400", children:
|
|
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
|
-
|
|
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(
|
|
264
|
-
/* @__PURE__ */ e(
|
|
265
|
-
/* @__PURE__ */ e(
|
|
266
|
-
/* @__PURE__ */ e(
|
|
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
|
-
|
|
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
|
|
3
|
-
import {
|
|
4
|
-
|
|
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__ */
|
|
7
|
-
|
|
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:
|
|
10
|
-
/* @__PURE__ */ e("p", { className: "mt-0.5 text-[12.5px] text-slate-500 dark:text-muted-foreground", children:
|
|
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(
|
|
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
|
-
|
|
43
|
+
x as NotificationSubscriptionsView
|
|
18
44
|
};
|