@burdenoff/microfe-subscriberbot 2026.706.2 → 2026.706.3
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/subscriberbot/SubscriberBotRoutes.js +14 -6
- package/dist/subscriberbot/SubscriberBotRoutes.js.map +1 -1
- package/dist/subscriberbot/components/index.js +7 -0
- package/dist/subscriberbot/components/viz.js +196 -0
- package/dist/subscriberbot/components/viz.js.map +1 -0
- package/dist/subscriberbot/hooks/useSubscriberBotApi.js +38 -30
- package/dist/subscriberbot/hooks/useSubscriberBotApi.js.map +1 -1
- package/dist/subscriberbot/pages/AssetVaultPage.js +182 -0
- package/dist/subscriberbot/pages/AssetVaultPage.js.map +1 -0
- package/dist/subscriberbot/pages/DashboardPage.js +272 -199
- package/dist/subscriberbot/pages/DashboardPage.js.map +1 -1
- package/dist/subscriberbot/pages/InboxPage.js +517 -234
- package/dist/subscriberbot/pages/InboxPage.js.map +1 -1
- package/dist/subscriberbot/pages/InsightsPage.js +220 -0
- package/dist/subscriberbot/pages/InsightsPage.js.map +1 -0
- package/dist/subscriberbot/pages/InvoicesPage.js +325 -237
- package/dist/subscriberbot/pages/InvoicesPage.js.map +1 -1
- package/dist/subscriberbot/pages/WorkflowsPage.js +301 -112
- package/dist/subscriberbot/pages/WorkflowsPage.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentDetailPage.js +311 -165
- package/dist/subscriberbot/pages/agents/AgentDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentsListPage.js +183 -93
- package/dist/subscriberbot/pages/agents/AgentsListPage.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.js +426 -293
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProviderNewPage.js +217 -153
- package/dist/subscriberbot/pages/providers/ProviderNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProvidersListPage.js +215 -112
- package/dist/subscriberbot/pages/providers/ProvidersListPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js +542 -428
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js +242 -192
- package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js +174 -133
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -5,16 +5,18 @@ import { formatEnumLabel as r } from "../../utils/formatters.js";
|
|
|
5
5
|
import { StatusBadge as i } from "../../components/StatusBadge.js";
|
|
6
6
|
import { EmptyState as a } from "../../components/EmptyState.js";
|
|
7
7
|
import { ErrorView as o, LoadingView as s } from "../../components/StateViews.js";
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
8
|
+
import { MiniProgress as c } from "../../components/viz.js";
|
|
9
|
+
import "../../components/index.js";
|
|
10
|
+
import { useProviders as l } from "../../hooks/useSubscriberBotApi.js";
|
|
11
|
+
import { useState as u } from "react";
|
|
12
|
+
import { Activity as d, BadgeCheck as f, Building2 as p, ChevronRight as m, Plus as h, Search as g, ShieldCheck as _, Store as v } from "lucide-react";
|
|
13
|
+
import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
14
|
+
import { EmphasisPanel as S, GlassCard as C, PagePurpose as w } from "@burdenoff/fe-libs/ui";
|
|
13
15
|
//#region src/subscriberbot/pages/providers/ProvidersListPage.tsx
|
|
14
|
-
var
|
|
16
|
+
var T = 24, E = [
|
|
15
17
|
{
|
|
16
18
|
value: "",
|
|
17
|
-
label: "All
|
|
19
|
+
label: "All"
|
|
18
20
|
},
|
|
19
21
|
{
|
|
20
22
|
value: "SAAS",
|
|
@@ -80,7 +82,7 @@ var y = 24, b = [
|
|
|
80
82
|
value: "OTHER",
|
|
81
83
|
label: "Other"
|
|
82
84
|
}
|
|
83
|
-
],
|
|
85
|
+
], D = [
|
|
84
86
|
{
|
|
85
87
|
value: "",
|
|
86
88
|
label: "Any status"
|
|
@@ -102,147 +104,248 @@ var y = 24, b = [
|
|
|
102
104
|
label: "Deprecated"
|
|
103
105
|
}
|
|
104
106
|
];
|
|
105
|
-
function
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
107
|
+
function O(e) {
|
|
108
|
+
return e >= 70 ? "positive" : e >= 45 ? "accent" : e >= 25 ? "warning" : "negative";
|
|
109
|
+
}
|
|
110
|
+
function k(e) {
|
|
111
|
+
return e >= 67 ? {
|
|
112
|
+
label: "High churn risk",
|
|
113
|
+
cls: "bg-status-error-bg-subtle text-status-error-text"
|
|
114
|
+
} : e >= 34 ? {
|
|
115
|
+
label: "Moderate churn risk",
|
|
116
|
+
cls: "bg-status-warning-bg-subtle text-status-warning-text"
|
|
117
|
+
} : {
|
|
118
|
+
label: "Low churn risk",
|
|
119
|
+
cls: "bg-status-success-bg-subtle text-status-success-text"
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
function A({ provider: e, onOpen: n }) {
|
|
123
|
+
let a = e.vendorHealthScore, o = e.churnRiskScore, s = o == null ? null : k(o);
|
|
124
|
+
return /* @__PURE__ */ x(C, {
|
|
125
|
+
treatment: "glass",
|
|
126
|
+
role: "button",
|
|
127
|
+
tabIndex: 0,
|
|
128
|
+
onClick: n,
|
|
129
|
+
onKeyDown: (e) => {
|
|
130
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), n());
|
|
131
|
+
},
|
|
132
|
+
"aria-label": `Open ${e.name}`,
|
|
133
|
+
className: "group flex cursor-pointer flex-col p-5 outline-none transition-all hover:-translate-y-0.5 hover:shadow-lg focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
|
|
134
|
+
children: [
|
|
135
|
+
/* @__PURE__ */ x("div", {
|
|
136
|
+
className: "flex items-start justify-between gap-2",
|
|
137
|
+
children: [/* @__PURE__ */ b("span", {
|
|
138
|
+
className: "flex size-10 items-center justify-center rounded-xl bg-[var(--color-accent-soft)] text-text-primary",
|
|
139
|
+
children: /* @__PURE__ */ b(p, { className: "h-5 w-5" })
|
|
140
|
+
}), /* @__PURE__ */ b(i, { status: e.status })]
|
|
141
|
+
}),
|
|
142
|
+
/* @__PURE__ */ b("p", {
|
|
143
|
+
className: "mt-3 truncate text-base font-semibold text-text-primary",
|
|
144
|
+
children: e.name
|
|
145
|
+
}),
|
|
146
|
+
/* @__PURE__ */ b("span", {
|
|
147
|
+
className: "mt-1 inline-flex w-fit rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs font-medium text-text-secondary",
|
|
148
|
+
children: r(e.category)
|
|
149
|
+
}),
|
|
150
|
+
e.description ? /* @__PURE__ */ b("p", {
|
|
151
|
+
className: "mt-3 line-clamp-2 min-h-[2.5rem] text-xs leading-relaxed text-text-secondary",
|
|
152
|
+
children: e.description
|
|
153
|
+
}) : /* @__PURE__ */ b("p", {
|
|
154
|
+
className: "mt-3 min-h-[2.5rem] text-xs italic text-text-secondary/70",
|
|
155
|
+
children: "No description yet."
|
|
156
|
+
}),
|
|
157
|
+
/* @__PURE__ */ x("div", {
|
|
158
|
+
className: "mt-4 border-t border-border-subtle pt-3",
|
|
159
|
+
children: [/* @__PURE__ */ x("div", {
|
|
160
|
+
className: "flex items-center justify-between text-xs",
|
|
161
|
+
children: [/* @__PURE__ */ x("span", {
|
|
162
|
+
className: "inline-flex items-center gap-1 text-text-secondary",
|
|
163
|
+
children: [/* @__PURE__ */ b(_, { className: "h-3.5 w-3.5" }), " Vendor health"]
|
|
164
|
+
}), /* @__PURE__ */ b("span", {
|
|
165
|
+
className: "font-semibold tabular-nums text-text-primary",
|
|
166
|
+
children: a == null ? "—" : `${a}/100`
|
|
167
|
+
})]
|
|
168
|
+
}), /* @__PURE__ */ b(c, {
|
|
169
|
+
value: a ?? 0,
|
|
170
|
+
tone: a == null ? "accent" : O(a),
|
|
171
|
+
className: "mt-1.5"
|
|
172
|
+
})]
|
|
173
|
+
}),
|
|
174
|
+
/* @__PURE__ */ x("div", {
|
|
175
|
+
className: "mt-3 flex flex-wrap items-center justify-between gap-2",
|
|
176
|
+
children: [/* @__PURE__ */ x("div", {
|
|
177
|
+
className: "flex flex-wrap items-center gap-2",
|
|
178
|
+
children: [s && /* @__PURE__ */ b("span", {
|
|
179
|
+
className: t("inline-flex rounded-full px-2 py-0.5 text-[11px] font-medium", s.cls),
|
|
180
|
+
children: s.label
|
|
181
|
+
}), e.region && /* @__PURE__ */ b("span", {
|
|
182
|
+
className: "text-[11px] text-text-secondary",
|
|
183
|
+
children: e.region
|
|
184
|
+
})]
|
|
185
|
+
}), /* @__PURE__ */ x("span", {
|
|
186
|
+
className: "inline-flex items-center gap-0.5 text-xs font-medium text-text-link opacity-0 transition-opacity group-hover:opacity-100",
|
|
187
|
+
children: ["View ", /* @__PURE__ */ b(m, { className: "h-3.5 w-3.5" })]
|
|
188
|
+
})]
|
|
189
|
+
})
|
|
190
|
+
]
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
function j() {
|
|
194
|
+
let { navigateTo: r } = e(), [i, c] = u(0), [m, _] = u(""), [O, k] = u(""), [j, M] = u(""), [N, P] = u(""), { data: F, isLoading: I, isError: L, refetch: R, isFetching: z } = l({
|
|
195
|
+
search: m || void 0,
|
|
196
|
+
category: j || void 0,
|
|
197
|
+
status: N || void 0,
|
|
110
198
|
pagination: {
|
|
111
|
-
limit:
|
|
112
|
-
offset:
|
|
199
|
+
limit: T,
|
|
200
|
+
offset: i * T
|
|
201
|
+
}
|
|
202
|
+
}), B = F?.items ?? [], V = F?.pageInfo.hasMore ?? !1, H = B.filter((e) => e.status === "VERIFIED").length, U = B.map((e) => e.vendorHealthScore).filter((e) => e != null), W = U.length ? Math.round(U.reduce((e, t) => e + t, 0) / U.length) : null, G = (e) => {
|
|
203
|
+
e.preventDefault(), _(O.trim()), c(0);
|
|
204
|
+
}, K = [
|
|
205
|
+
{
|
|
206
|
+
icon: v,
|
|
207
|
+
label: "On this page",
|
|
208
|
+
value: String(B.length)
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
icon: f,
|
|
212
|
+
label: "Verified",
|
|
213
|
+
value: String(H)
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
icon: d,
|
|
217
|
+
label: "Avg. vendor health",
|
|
218
|
+
value: W == null ? "—" : `${W}/100`
|
|
113
219
|
}
|
|
114
|
-
|
|
115
|
-
return /* @__PURE__ */
|
|
116
|
-
title: "
|
|
117
|
-
description: "
|
|
118
|
-
actions: /* @__PURE__ */
|
|
220
|
+
];
|
|
221
|
+
return /* @__PURE__ */ x(n, {
|
|
222
|
+
title: "Discover providers",
|
|
223
|
+
description: "Browse the global provider registry — the public face of the Subscription Knowledge Graph",
|
|
224
|
+
actions: /* @__PURE__ */ x("button", {
|
|
119
225
|
type: "button",
|
|
120
|
-
onClick: () =>
|
|
226
|
+
onClick: () => r("/providers/new"),
|
|
121
227
|
className: "inline-flex items-center gap-2 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90",
|
|
122
|
-
children: [/* @__PURE__ */ h
|
|
228
|
+
children: [/* @__PURE__ */ b(h, { className: "h-4 w-4" }), " Add provider"]
|
|
123
229
|
}),
|
|
124
230
|
children: [
|
|
125
|
-
/* @__PURE__ */
|
|
231
|
+
/* @__PURE__ */ b(w, {
|
|
126
232
|
className: "mb-4",
|
|
127
|
-
children: "
|
|
233
|
+
children: "Every provider exists here whether or not it integrates. Search and filter to find the ones you have relationships with, compare their vendor health, or add a new one."
|
|
128
234
|
}),
|
|
129
|
-
/* @__PURE__ */
|
|
130
|
-
onSubmit:
|
|
131
|
-
e.preventDefault(), E(D.trim()), w(0);
|
|
132
|
-
},
|
|
235
|
+
/* @__PURE__ */ b(S, { children: /* @__PURE__ */ x("form", {
|
|
236
|
+
onSubmit: G,
|
|
133
237
|
className: "relative",
|
|
134
|
-
children: [
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
238
|
+
children: [
|
|
239
|
+
/* @__PURE__ */ b(g, { className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-secondary" }),
|
|
240
|
+
/* @__PURE__ */ b("input", {
|
|
241
|
+
type: "text",
|
|
242
|
+
placeholder: "Search providers by name…",
|
|
243
|
+
value: O,
|
|
244
|
+
onChange: (e) => k(e.target.value),
|
|
245
|
+
className: "w-full rounded-lg border border-border-subtle bg-bg-surface py-2.5 pl-10 pr-24 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
246
|
+
}),
|
|
247
|
+
/* @__PURE__ */ b("button", {
|
|
248
|
+
type: "submit",
|
|
249
|
+
className: "absolute right-1.5 top-1/2 -translate-y-1/2 rounded-md bg-action-primary-bg px-3 py-1.5 text-xs font-medium text-action-primary-text hover:opacity-90",
|
|
250
|
+
children: "Search"
|
|
251
|
+
})
|
|
252
|
+
]
|
|
141
253
|
}) }),
|
|
142
|
-
/* @__PURE__ */
|
|
143
|
-
className: "mt-4 flex
|
|
144
|
-
children:
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
254
|
+
/* @__PURE__ */ b("div", {
|
|
255
|
+
className: "mt-4 flex items-center gap-2 overflow-x-auto pb-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
|
|
256
|
+
children: E.map((e) => {
|
|
257
|
+
let n = j === e.value;
|
|
258
|
+
return /* @__PURE__ */ b("button", {
|
|
259
|
+
type: "button",
|
|
260
|
+
"aria-pressed": n,
|
|
261
|
+
onClick: () => {
|
|
262
|
+
M(e.value), c(0);
|
|
263
|
+
},
|
|
264
|
+
className: t("shrink-0 rounded-full border px-3.5 py-1.5 text-xs font-medium transition-colors", n ? "border-transparent bg-action-primary-bg text-action-primary-text" : "border-border-subtle bg-bg-surface text-text-secondary hover:bg-bg-sunken hover:text-text-primary"),
|
|
153
265
|
children: e.label
|
|
154
|
-
}, e.value)
|
|
155
|
-
})
|
|
266
|
+
}, e.value || "all");
|
|
267
|
+
})
|
|
268
|
+
}),
|
|
269
|
+
/* @__PURE__ */ b("div", {
|
|
270
|
+
className: "mt-3 flex flex-wrap items-center gap-2",
|
|
271
|
+
children: /* @__PURE__ */ b("select", {
|
|
156
272
|
"aria-label": "Filter by status",
|
|
157
|
-
value:
|
|
273
|
+
value: N,
|
|
158
274
|
onChange: (e) => {
|
|
159
|
-
|
|
275
|
+
P(e.target.value), c(0);
|
|
160
276
|
},
|
|
161
277
|
className: "rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-xs text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
|
|
162
|
-
children:
|
|
278
|
+
children: D.map((e) => /* @__PURE__ */ b("option", {
|
|
163
279
|
value: e.value,
|
|
164
280
|
children: e.label
|
|
165
281
|
}, e.value))
|
|
166
|
-
})
|
|
282
|
+
})
|
|
167
283
|
}),
|
|
168
|
-
|
|
284
|
+
!I && !L && B.length > 0 && /* @__PURE__ */ b("div", {
|
|
285
|
+
className: "mt-4 grid grid-cols-1 gap-3 sm:grid-cols-3",
|
|
286
|
+
children: K.map((e) => /* @__PURE__ */ x(C, {
|
|
287
|
+
treatment: "metric",
|
|
288
|
+
className: "flex items-center gap-3 p-4",
|
|
289
|
+
children: [/* @__PURE__ */ b("span", {
|
|
290
|
+
className: "flex size-9 shrink-0 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-text-primary",
|
|
291
|
+
children: /* @__PURE__ */ b(e.icon, { className: "h-4 w-4" })
|
|
292
|
+
}), /* @__PURE__ */ x("div", {
|
|
293
|
+
className: "min-w-0",
|
|
294
|
+
children: [/* @__PURE__ */ b("p", {
|
|
295
|
+
className: "truncate text-xs text-text-secondary",
|
|
296
|
+
children: e.label
|
|
297
|
+
}), /* @__PURE__ */ b("p", {
|
|
298
|
+
className: "text-lg font-semibold tabular-nums text-text-primary",
|
|
299
|
+
children: e.value
|
|
300
|
+
})]
|
|
301
|
+
})]
|
|
302
|
+
}, e.label))
|
|
303
|
+
}),
|
|
304
|
+
I ? /* @__PURE__ */ b(s, { label: "Loading providers…" }) : L ? /* @__PURE__ */ b(o, {
|
|
169
305
|
message: "Could not load the provider registry.",
|
|
170
|
-
onRetry: () => void
|
|
171
|
-
}) :
|
|
306
|
+
onRetry: () => void R()
|
|
307
|
+
}) : B.length === 0 ? /* @__PURE__ */ b("div", {
|
|
172
308
|
className: "mt-6",
|
|
173
|
-
children: /* @__PURE__ */
|
|
309
|
+
children: /* @__PURE__ */ b(a, {
|
|
174
310
|
illustration: "empty-search",
|
|
175
|
-
icon: /* @__PURE__ */
|
|
311
|
+
icon: /* @__PURE__ */ b(p, { className: "h-12 w-12" }),
|
|
176
312
|
title: "No providers found",
|
|
177
|
-
description:
|
|
178
|
-
action: /* @__PURE__ */
|
|
313
|
+
description: m ? `No providers match "${m}".` : "No providers in the registry with these filters yet.",
|
|
314
|
+
action: /* @__PURE__ */ b("button", {
|
|
179
315
|
type: "button",
|
|
180
|
-
onClick: () =>
|
|
316
|
+
onClick: () => r("/providers/new"),
|
|
181
317
|
className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90",
|
|
182
318
|
children: "Add provider"
|
|
183
319
|
})
|
|
184
320
|
})
|
|
185
|
-
}) : /* @__PURE__ */
|
|
321
|
+
}) : /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("div", {
|
|
186
322
|
className: "mt-6 grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",
|
|
187
|
-
children:
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
className: "flex flex-col rounded-lg border border-border-subtle bg-bg-surface p-4 text-left transition-shadow hover:shadow-md",
|
|
191
|
-
children: [
|
|
192
|
-
/* @__PURE__ */ g("div", {
|
|
193
|
-
className: "flex items-start justify-between gap-2",
|
|
194
|
-
children: [/* @__PURE__ */ h("span", {
|
|
195
|
-
className: "flex size-9 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-text-primary",
|
|
196
|
-
children: /* @__PURE__ */ h(u, { className: "h-4 w-4" })
|
|
197
|
-
}), /* @__PURE__ */ h(i, { status: e.status })]
|
|
198
|
-
}),
|
|
199
|
-
/* @__PURE__ */ h("p", {
|
|
200
|
-
className: "mt-3 truncate text-sm font-semibold text-text-primary",
|
|
201
|
-
children: e.name
|
|
202
|
-
}),
|
|
203
|
-
/* @__PURE__ */ h("p", {
|
|
204
|
-
className: "text-xs text-text-secondary",
|
|
205
|
-
children: r(e.category)
|
|
206
|
-
}),
|
|
207
|
-
e.description && /* @__PURE__ */ h("p", {
|
|
208
|
-
className: "mt-2 line-clamp-2 text-xs text-text-secondary",
|
|
209
|
-
children: e.description
|
|
210
|
-
}),
|
|
211
|
-
/* @__PURE__ */ g("div", {
|
|
212
|
-
className: "mt-3 flex flex-wrap items-center gap-2 text-xs text-text-secondary",
|
|
213
|
-
children: [e.region && /* @__PURE__ */ h("span", { children: e.region }), e.vendorHealthScore != null && /* @__PURE__ */ g("span", {
|
|
214
|
-
className: "inline-flex items-center gap-1",
|
|
215
|
-
children: [
|
|
216
|
-
/* @__PURE__ */ h(p, { className: "h-3 w-3" }),
|
|
217
|
-
e.vendorHealthScore,
|
|
218
|
-
"/100"
|
|
219
|
-
]
|
|
220
|
-
})]
|
|
221
|
-
})
|
|
222
|
-
]
|
|
323
|
+
children: B.map((e) => /* @__PURE__ */ b(A, {
|
|
324
|
+
provider: e,
|
|
325
|
+
onOpen: () => r(`/providers/${e.id}`)
|
|
223
326
|
}, e.id))
|
|
224
|
-
}), /* @__PURE__ */
|
|
225
|
-
className: "mt-
|
|
226
|
-
children: [/* @__PURE__ */
|
|
327
|
+
}), /* @__PURE__ */ x("div", {
|
|
328
|
+
className: "mt-6 flex items-center justify-between",
|
|
329
|
+
children: [/* @__PURE__ */ x("p", {
|
|
227
330
|
className: "text-xs text-text-secondary",
|
|
228
331
|
children: [
|
|
229
332
|
"Page ",
|
|
230
|
-
|
|
231
|
-
|
|
333
|
+
i + 1,
|
|
334
|
+
z ? " · refreshing…" : ""
|
|
232
335
|
]
|
|
233
|
-
}), /* @__PURE__ */
|
|
336
|
+
}), /* @__PURE__ */ x("div", {
|
|
234
337
|
className: "flex gap-2",
|
|
235
|
-
children: [/* @__PURE__ */
|
|
338
|
+
children: [/* @__PURE__ */ b("button", {
|
|
236
339
|
type: "button",
|
|
237
|
-
disabled:
|
|
238
|
-
onClick: () =>
|
|
239
|
-
className: t("rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium",
|
|
340
|
+
disabled: i === 0,
|
|
341
|
+
onClick: () => c((e) => Math.max(0, e - 1)),
|
|
342
|
+
className: t("rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium", i === 0 ? "cursor-not-allowed text-text-secondary opacity-50" : "text-text-primary hover:bg-bg-sunken"),
|
|
240
343
|
children: "Previous"
|
|
241
|
-
}), /* @__PURE__ */
|
|
344
|
+
}), /* @__PURE__ */ b("button", {
|
|
242
345
|
type: "button",
|
|
243
|
-
disabled: !
|
|
244
|
-
onClick: () =>
|
|
245
|
-
className: t("rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium",
|
|
346
|
+
disabled: !V,
|
|
347
|
+
onClick: () => c((e) => e + 1),
|
|
348
|
+
className: t("rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium", V ? "text-text-primary hover:bg-bg-sunken" : "cursor-not-allowed text-text-secondary opacity-50"),
|
|
246
349
|
children: "Next"
|
|
247
350
|
})]
|
|
248
351
|
})]
|
|
@@ -251,6 +354,6 @@ function S() {
|
|
|
251
354
|
});
|
|
252
355
|
}
|
|
253
356
|
//#endregion
|
|
254
|
-
export {
|
|
357
|
+
export { j as ProvidersListPage };
|
|
255
358
|
|
|
256
359
|
//# sourceMappingURL=ProvidersListPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProvidersListPage.js","names":[],"sources":["../../../../src/subscriberbot/pages/providers/ProvidersListPage.tsx"],"sourcesContent":["/**\n * Providers list (Global Provider Registry)\n * @module subscriberbot/pages/providers\n *\n * Discovery: search and browse the provider registry. Server-side search +\n * category/status filters + pagination via `subListProviders`\n * (a SubProviderConnection).\n */\n\nimport { useState } from 'react';\nimport { Plus, Search, Building2, ShieldCheck } from 'lucide-react';\nimport { EmphasisPanel, PagePurpose } from '@burdenoff/fe-libs/ui';\nimport { PageLayout } from '../../components/PageLayout';\nimport { StatusBadge } from '../../components/StatusBadge';\nimport { EmptyState } from '../../components/EmptyState';\nimport { LoadingView, ErrorView } from '../../components/StateViews';\nimport { useSubscriberBot } from '../../context/SubscriberBotContext';\nimport { useProviders } from '../../hooks/useSubscriberBotApi';\nimport { cn } from '../../utils/cn';\nimport { formatEnumLabel } from '../../utils/formatters';\nimport type { SubProviderCategory, SubProviderStatus } from '../../types';\n\nconst PAGE_SIZE = 24;\n\nconst CATEGORY_OPTIONS: Array<{ value: '' | SubProviderCategory; label: string }> = [\n { value: '', label: 'All categories' },\n { value: 'SAAS', label: 'SaaS' },\n { value: 'AI_SERVICE', label: 'AI service' },\n { value: 'STREAMING', label: 'Streaming' },\n { value: 'NEWSLETTER', label: 'Newsletter' },\n { value: 'NEWS_DIGEST', label: 'News digest' },\n { value: 'MEMBERSHIP', label: 'Membership' },\n { value: 'COMMUNITY', label: 'Community' },\n { value: 'EDUCATION', label: 'Education' },\n { value: 'FINANCIAL', label: 'Financial' },\n { value: 'INSURANCE', label: 'Insurance' },\n { value: 'TELECOM', label: 'Telecom' },\n { value: 'UTILITY', label: 'Utility' },\n { value: 'ASSOCIATION', label: 'Association' },\n { value: 'LICENSE', label: 'License' },\n { value: 'CONTRACT', label: 'Contract' },\n { value: 'OTHER', label: 'Other' },\n];\n\nconst STATUS_OPTIONS: Array<{ value: '' | SubProviderStatus; label: string }> = [\n { value: '', label: 'Any status' },\n { value: 'VERIFIED', label: 'Verified' },\n { value: 'CLAIMED', label: 'Claimed' },\n { value: 'UNVERIFIED', label: 'Unverified' },\n { value: 'DEPRECATED', label: 'Deprecated' },\n];\n\nexport function ProvidersListPage() {\n const { navigateTo } = useSubscriberBot();\n const [page, setPage] = useState(0);\n const [search, setSearch] = useState('');\n const [searchInput, setSearchInput] = useState('');\n const [category, setCategory] = useState<'' | SubProviderCategory>('');\n const [status, setStatus] = useState<'' | SubProviderStatus>('');\n\n const { data, isLoading, isError, refetch, isFetching } = useProviders({\n search: search || undefined,\n category: category || undefined,\n status: status || undefined,\n pagination: { limit: PAGE_SIZE, offset: page * PAGE_SIZE },\n });\n\n const items = data?.items ?? [];\n const hasMore = data?.pageInfo.hasMore ?? false;\n\n const submitSearch = (e: React.FormEvent) => {\n e.preventDefault();\n setSearch(searchInput.trim());\n setPage(0);\n };\n\n return (\n <PageLayout\n title=\"Providers\"\n description=\"Discover and browse the global provider registry\"\n actions={\n <button\n type=\"button\"\n onClick={() => navigateTo('/providers/new')}\n className=\"inline-flex items-center gap-2 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90\"\n >\n <Plus className=\"h-4 w-4\" /> Add provider\n </button>\n }\n >\n <PagePurpose className=\"mb-4\">\n The registry is the public face of the Subscription Knowledge Graph — every provider exists\n here whether or not it integrates. Search and filter to find the ones you have relationships\n with, or add a new one.\n </PagePurpose>\n\n <EmphasisPanel>\n <form onSubmit={submitSearch} className=\"relative\">\n <Search className=\"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-secondary\" />\n <input\n type=\"text\"\n placeholder=\"Search providers by name…\"\n value={searchInput}\n onChange={(e) => setSearchInput(e.target.value)}\n className=\"w-full rounded-lg border border-border-subtle bg-bg-surface py-2.5 pl-10 pr-3 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n </form>\n </EmphasisPanel>\n\n <div className=\"mt-4 flex flex-wrap items-center gap-3\">\n <select\n aria-label=\"Filter by category\"\n value={category}\n onChange={(e) => {\n setCategory(e.target.value as '' | SubProviderCategory);\n setPage(0);\n }}\n className=\"rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-xs text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n >\n {CATEGORY_OPTIONS.map((o) => (\n <option key={o.value} value={o.value}>\n {o.label}\n </option>\n ))}\n </select>\n <select\n aria-label=\"Filter by status\"\n value={status}\n onChange={(e) => {\n setStatus(e.target.value as '' | SubProviderStatus);\n setPage(0);\n }}\n className=\"rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-xs text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n >\n {STATUS_OPTIONS.map((o) => (\n <option key={o.value} value={o.value}>\n {o.label}\n </option>\n ))}\n </select>\n </div>\n\n {isLoading ? (\n <LoadingView label=\"Loading providers…\" />\n ) : isError ? (\n <ErrorView message=\"Could not load the provider registry.\" onRetry={() => void refetch()} />\n ) : items.length === 0 ? (\n <div className=\"mt-6\">\n <EmptyState\n illustration=\"empty-search\"\n icon={<Building2 className=\"h-12 w-12\" />}\n title=\"No providers found\"\n description={\n search\n ? `No providers match \"${search}\".`\n : 'No providers in the registry with these filters yet.'\n }\n action={\n <button\n type=\"button\"\n onClick={() => navigateTo('/providers/new')}\n className=\"rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90\"\n >\n Add provider\n </button>\n }\n />\n </div>\n ) : (\n <>\n <div className=\"mt-6 grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3\">\n {items.map((p) => (\n <button\n key={p.id}\n type=\"button\"\n onClick={() => navigateTo(`/providers/${p.id}`)}\n className=\"flex flex-col rounded-lg border border-border-subtle bg-bg-surface p-4 text-left transition-shadow hover:shadow-md\"\n >\n <div className=\"flex items-start justify-between gap-2\">\n <span className=\"flex size-9 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-text-primary\">\n <Building2 className=\"h-4 w-4\" />\n </span>\n <StatusBadge status={p.status} />\n </div>\n <p className=\"mt-3 truncate text-sm font-semibold text-text-primary\">{p.name}</p>\n <p className=\"text-xs text-text-secondary\">{formatEnumLabel(p.category)}</p>\n {p.description && (\n <p className=\"mt-2 line-clamp-2 text-xs text-text-secondary\">{p.description}</p>\n )}\n <div className=\"mt-3 flex flex-wrap items-center gap-2 text-xs text-text-secondary\">\n {p.region && <span>{p.region}</span>}\n {p.vendorHealthScore != null && (\n <span className=\"inline-flex items-center gap-1\">\n <ShieldCheck className=\"h-3 w-3\" />\n {p.vendorHealthScore}/100\n </span>\n )}\n </div>\n </button>\n ))}\n </div>\n\n <div className=\"mt-4 flex items-center justify-between\">\n <p className=\"text-xs text-text-secondary\">\n Page {page + 1}\n {isFetching ? ' · refreshing…' : ''}\n </p>\n <div className=\"flex gap-2\">\n <button\n type=\"button\"\n disabled={page === 0}\n onClick={() => setPage((p) => Math.max(0, p - 1))}\n className={cn(\n 'rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium',\n page === 0\n ? 'cursor-not-allowed text-text-secondary opacity-50'\n : 'text-text-primary hover:bg-bg-sunken'\n )}\n >\n Previous\n </button>\n <button\n type=\"button\"\n disabled={!hasMore}\n onClick={() => setPage((p) => p + 1)}\n className={cn(\n 'rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium',\n !hasMore\n ? 'cursor-not-allowed text-text-secondary opacity-50'\n : 'text-text-primary hover:bg-bg-sunken'\n )}\n >\n Next\n </button>\n </div>\n </div>\n </>\n )}\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAsBA,IAAM,IAAY,IAEZ,IAA8E;CAClF;EAAE,OAAO;EAAI,OAAO;EAAkB;CACtC;EAAE,OAAO;EAAQ,OAAO;EA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AAa,mBAAmB;MAC/B;QACJ,kBAAC,OAAD;KAAK,WAAU;eAAf,CACE,kBAAC,UAAD;MACE,MAAK;MACL,UAAU,MAAS;MACnB,eAAe,GAAS,MAAM,KAAK,IAAI,GAAG,IAAI,EAAE,CAAC;MACjD,WAAW,EACT,0EACA,MAAS,IACL,sDACA,uCACL;gBACF;MAEQ,CAAA,EACT,kBAAC,UAAD;MACE,MAAK;MACL,UAAU,CAAC;MACX,eAAe,GAAS,MAAM,IAAI,EAAE;MACpC,WAAW,EACT,0EACC,IAEG,yCADA,oDAEL;gBACF;MAEQ,CAAA,CACL;OACF;MACL,EAAA,CAAA;GAEM"}
|
|
1
|
+
{"version":3,"file":"ProvidersListPage.js","names":[],"sources":["../../../../src/subscriberbot/pages/providers/ProvidersListPage.tsx"],"sourcesContent":["/**\n * Providers list (Global Provider Registry)\n * @module subscriberbot/pages/providers\n *\n * Discovery marketplace: search and browse the provider registry. Server-side\n * search + category/status filters + pagination via `subListProviders`\n * (a SubProviderConnection). Category filter chips, a responsive grid of glass\n * provider cards with a real vendor-health indicator + churn hint, and a small\n * live summary strip computed from the fetched page.\n */\n\nimport { useState } from 'react';\nimport {\n Plus,\n Search,\n Building2,\n ShieldCheck,\n ChevronRight,\n Store,\n Activity,\n BadgeCheck,\n} from 'lucide-react';\nimport { EmphasisPanel, PagePurpose, GlassCard } from '@burdenoff/fe-libs/ui';\nimport { PageLayout } from '../../components/PageLayout';\nimport { StatusBadge } from '../../components/StatusBadge';\nimport { EmptyState } from '../../components/EmptyState';\nimport { LoadingView, ErrorView } from '../../components/StateViews';\nimport { MiniProgress } from '../../components';\nimport { useSubscriberBot } from '../../context/SubscriberBotContext';\nimport { useProviders } from '../../hooks/useSubscriberBotApi';\nimport { cn } from '../../utils/cn';\nimport { formatEnumLabel } from '../../utils/formatters';\nimport type { SubProvider, SubProviderCategory, SubProviderStatus } from '../../types';\n\nconst PAGE_SIZE = 24;\n\nconst CATEGORY_OPTIONS: Array<{ value: '' | SubProviderCategory; label: string }> = [\n { value: '', label: 'All' },\n { value: 'SAAS', label: 'SaaS' },\n { value: 'AI_SERVICE', label: 'AI service' },\n { value: 'STREAMING', label: 'Streaming' },\n { value: 'NEWSLETTER', label: 'Newsletter' },\n { value: 'NEWS_DIGEST', label: 'News digest' },\n { value: 'MEMBERSHIP', label: 'Membership' },\n { value: 'COMMUNITY', label: 'Community' },\n { value: 'EDUCATION', label: 'Education' },\n { value: 'FINANCIAL', label: 'Financial' },\n { value: 'INSURANCE', label: 'Insurance' },\n { value: 'TELECOM', label: 'Telecom' },\n { value: 'UTILITY', label: 'Utility' },\n { value: 'ASSOCIATION', label: 'Association' },\n { value: 'LICENSE', label: 'License' },\n { value: 'CONTRACT', label: 'Contract' },\n { value: 'OTHER', label: 'Other' },\n];\n\nconst STATUS_OPTIONS: Array<{ value: '' | SubProviderStatus; label: string }> = [\n { value: '', label: 'Any status' },\n { value: 'VERIFIED', label: 'Verified' },\n { value: 'CLAIMED', label: 'Claimed' },\n { value: 'UNVERIFIED', label: 'Unverified' },\n { value: 'DEPRECATED', label: 'Deprecated' },\n];\n\n/** Map a 0–100 vendor-health score to a MiniProgress tone. Higher is healthier. */\nfunction healthTone(score: number): 'positive' | 'accent' | 'warning' | 'negative' {\n if (score >= 70) return 'positive';\n if (score >= 45) return 'accent';\n if (score >= 25) return 'warning';\n return 'negative';\n}\n\n/** Map a 0–100 churn-risk score to a label + semantic tone. Higher is worse. */\nfunction churnMeta(score: number): { label: string; cls: string } {\n if (score >= 67)\n return {\n label: 'High churn risk',\n cls: 'bg-status-error-bg-subtle text-status-error-text',\n };\n if (score >= 34)\n return {\n label: 'Moderate churn risk',\n cls: 'bg-status-warning-bg-subtle text-status-warning-text',\n };\n return {\n label: 'Low churn risk',\n cls: 'bg-status-success-bg-subtle text-status-success-text',\n };\n}\n\nfunction ProviderCard({ provider, onOpen }: { provider: SubProvider; onOpen: () => void }) {\n const health = provider.vendorHealthScore;\n const churn = provider.churnRiskScore;\n const churnInfo = churn != null ? churnMeta(churn) : null;\n\n return (\n <GlassCard\n treatment=\"glass\"\n role=\"button\"\n tabIndex={0}\n onClick={onOpen}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n onOpen();\n }\n }}\n aria-label={`Open ${provider.name}`}\n className=\"group flex cursor-pointer flex-col p-5 outline-none transition-all hover:-translate-y-0.5 hover:shadow-lg focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]\"\n >\n <div className=\"flex items-start justify-between gap-2\">\n <span className=\"flex size-10 items-center justify-center rounded-xl bg-[var(--color-accent-soft)] text-text-primary\">\n <Building2 className=\"h-5 w-5\" />\n </span>\n <StatusBadge status={provider.status} />\n </div>\n\n <p className=\"mt-3 truncate text-base font-semibold text-text-primary\">{provider.name}</p>\n <span className=\"mt-1 inline-flex w-fit rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs font-medium text-text-secondary\">\n {formatEnumLabel(provider.category)}\n </span>\n\n {provider.description ? (\n <p className=\"mt-3 line-clamp-2 min-h-[2.5rem] text-xs leading-relaxed text-text-secondary\">\n {provider.description}\n </p>\n ) : (\n <p className=\"mt-3 min-h-[2.5rem] text-xs italic text-text-secondary/70\">\n No description yet.\n </p>\n )}\n\n <div className=\"mt-4 border-t border-border-subtle pt-3\">\n <div className=\"flex items-center justify-between text-xs\">\n <span className=\"inline-flex items-center gap-1 text-text-secondary\">\n <ShieldCheck className=\"h-3.5 w-3.5\" /> Vendor health\n </span>\n <span className=\"font-semibold tabular-nums text-text-primary\">\n {health != null ? `${health}/100` : '—'}\n </span>\n </div>\n <MiniProgress\n value={health ?? 0}\n tone={health != null ? healthTone(health) : 'accent'}\n className=\"mt-1.5\"\n />\n </div>\n\n <div className=\"mt-3 flex flex-wrap items-center justify-between gap-2\">\n <div className=\"flex flex-wrap items-center gap-2\">\n {churnInfo && (\n <span\n className={cn(\n 'inline-flex rounded-full px-2 py-0.5 text-[11px] font-medium',\n churnInfo.cls\n )}\n >\n {churnInfo.label}\n </span>\n )}\n {provider.region && (\n <span className=\"text-[11px] text-text-secondary\">{provider.region}</span>\n )}\n </div>\n <span className=\"inline-flex items-center gap-0.5 text-xs font-medium text-text-link opacity-0 transition-opacity group-hover:opacity-100\">\n View <ChevronRight className=\"h-3.5 w-3.5\" />\n </span>\n </div>\n </GlassCard>\n );\n}\n\nexport function ProvidersListPage() {\n const { navigateTo } = useSubscriberBot();\n const [page, setPage] = useState(0);\n const [search, setSearch] = useState('');\n const [searchInput, setSearchInput] = useState('');\n const [category, setCategory] = useState<'' | SubProviderCategory>('');\n const [status, setStatus] = useState<'' | SubProviderStatus>('');\n\n const { data, isLoading, isError, refetch, isFetching } = useProviders({\n search: search || undefined,\n category: category || undefined,\n status: status || undefined,\n pagination: { limit: PAGE_SIZE, offset: page * PAGE_SIZE },\n });\n\n const items = data?.items ?? [];\n const hasMore = data?.pageInfo.hasMore ?? false;\n\n // Live summary strip — computed from the fetched page (never fabricated).\n const verifiedCount = items.filter((p) => p.status === 'VERIFIED').length;\n const healthScores = items\n .map((p) => p.vendorHealthScore)\n .filter((s): s is number => s != null);\n const avgHealth = healthScores.length\n ? Math.round(healthScores.reduce((a, b) => a + b, 0) / healthScores.length)\n : null;\n\n const submitSearch = (e: React.FormEvent) => {\n e.preventDefault();\n setSearch(searchInput.trim());\n setPage(0);\n };\n\n const summary: Array<{ icon: typeof Store; label: string; value: string }> = [\n { icon: Store, label: 'On this page', value: String(items.length) },\n { icon: BadgeCheck, label: 'Verified', value: String(verifiedCount) },\n {\n icon: Activity,\n label: 'Avg. vendor health',\n value: avgHealth != null ? `${avgHealth}/100` : '—',\n },\n ];\n\n return (\n <PageLayout\n title=\"Discover providers\"\n description=\"Browse the global provider registry — the public face of the Subscription Knowledge Graph\"\n actions={\n <button\n type=\"button\"\n onClick={() => navigateTo('/providers/new')}\n className=\"inline-flex items-center gap-2 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90\"\n >\n <Plus className=\"h-4 w-4\" /> Add provider\n </button>\n }\n >\n <PagePurpose className=\"mb-4\">\n Every provider exists here whether or not it integrates. Search and filter to find the ones\n you have relationships with, compare their vendor health, or add a new one.\n </PagePurpose>\n\n <EmphasisPanel>\n <form onSubmit={submitSearch} className=\"relative\">\n <Search className=\"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-secondary\" />\n <input\n type=\"text\"\n placeholder=\"Search providers by name…\"\n value={searchInput}\n onChange={(e) => setSearchInput(e.target.value)}\n className=\"w-full rounded-lg border border-border-subtle bg-bg-surface py-2.5 pl-10 pr-24 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n <button\n type=\"submit\"\n className=\"absolute right-1.5 top-1/2 -translate-y-1/2 rounded-md bg-action-primary-bg px-3 py-1.5 text-xs font-medium text-action-primary-text hover:opacity-90\"\n >\n Search\n </button>\n </form>\n </EmphasisPanel>\n\n {/* Category filter chips */}\n <div className=\"mt-4 flex items-center gap-2 overflow-x-auto pb-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden\">\n {CATEGORY_OPTIONS.map((o) => {\n const active = category === o.value;\n return (\n <button\n key={o.value || 'all'}\n type=\"button\"\n aria-pressed={active}\n onClick={() => {\n setCategory(o.value);\n setPage(0);\n }}\n className={cn(\n 'shrink-0 rounded-full border px-3.5 py-1.5 text-xs font-medium transition-colors',\n active\n ? 'border-transparent bg-action-primary-bg text-action-primary-text'\n : 'border-border-subtle bg-bg-surface text-text-secondary hover:bg-bg-sunken hover:text-text-primary'\n )}\n >\n {o.label}\n </button>\n );\n })}\n </div>\n\n <div className=\"mt-3 flex flex-wrap items-center gap-2\">\n <select\n aria-label=\"Filter by status\"\n value={status}\n onChange={(e) => {\n setStatus(e.target.value as '' | SubProviderStatus);\n setPage(0);\n }}\n className=\"rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-xs text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n >\n {STATUS_OPTIONS.map((o) => (\n <option key={o.value} value={o.value}>\n {o.label}\n </option>\n ))}\n </select>\n </div>\n\n {/* Live summary strip */}\n {!isLoading && !isError && items.length > 0 && (\n <div className=\"mt-4 grid grid-cols-1 gap-3 sm:grid-cols-3\">\n {summary.map((s) => (\n <GlassCard\n key={s.label}\n treatment=\"metric\"\n className=\"flex items-center gap-3 p-4\"\n >\n <span className=\"flex size-9 shrink-0 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-text-primary\">\n <s.icon className=\"h-4 w-4\" />\n </span>\n <div className=\"min-w-0\">\n <p className=\"truncate text-xs text-text-secondary\">{s.label}</p>\n <p className=\"text-lg font-semibold tabular-nums text-text-primary\">{s.value}</p>\n </div>\n </GlassCard>\n ))}\n </div>\n )}\n\n {isLoading ? (\n <LoadingView label=\"Loading providers…\" />\n ) : isError ? (\n <ErrorView message=\"Could not load the provider registry.\" onRetry={() => void refetch()} />\n ) : items.length === 0 ? (\n <div className=\"mt-6\">\n <EmptyState\n illustration=\"empty-search\"\n icon={<Building2 className=\"h-12 w-12\" />}\n title=\"No providers found\"\n description={\n search\n ? `No providers match \"${search}\".`\n : 'No providers in the registry with these filters yet.'\n }\n action={\n <button\n type=\"button\"\n onClick={() => navigateTo('/providers/new')}\n className=\"rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90\"\n >\n Add provider\n </button>\n }\n />\n </div>\n ) : (\n <>\n <div className=\"mt-6 grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3\">\n {items.map((p) => (\n <ProviderCard key={p.id} provider={p} onOpen={() => navigateTo(`/providers/${p.id}`)} />\n ))}\n </div>\n\n <div className=\"mt-6 flex items-center justify-between\">\n <p className=\"text-xs text-text-secondary\">\n Page {page + 1}\n {isFetching ? ' · refreshing…' : ''}\n </p>\n <div className=\"flex gap-2\">\n <button\n type=\"button\"\n disabled={page === 0}\n onClick={() => setPage((p) => Math.max(0, p - 1))}\n className={cn(\n 'rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium',\n page === 0\n ? 'cursor-not-allowed text-text-secondary opacity-50'\n : 'text-text-primary hover:bg-bg-sunken'\n )}\n >\n Previous\n </button>\n <button\n type=\"button\"\n disabled={!hasMore}\n onClick={() => setPage((p) => p + 1)}\n className={cn(\n 'rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium',\n !hasMore\n ? 'cursor-not-allowed text-text-secondary opacity-50'\n : 'text-text-primary hover:bg-bg-sunken'\n )}\n >\n Next\n </button>\n </div>\n </div>\n </>\n )}\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAkCA,IAAM,IAAY,IAEZ,IAA8E;CAClF;EAAE,OAAO;EAAI,OAAO;EAAO;CAC3B;EAAE,OAAO;EAAQ,OAAO;EAAQ;CAChC;EAAE,OAAO;EAAc,OAAO;EAAc;CAC5C;EAAE,OAAO;EAAa,OAAO;EAAa;CAC1C;EAAE,OAAO;EAAc,OAAO;EAAc;CAC5C;EAAE,OAAO;EAAe,OAAO;EAAe;CAC9C;EAAE,OAAO;EAAc,OAAO;EAAc;CAC5C;EAAE,OAAO;EAAa,OAAO;EAAa;CAC1C;EAAE,OAAO;EAAa,OAAO;EAAa;CAC1C;EAAE,OAAO;EAAa,OAAO;EAAa;CAC1C;EAAE,OAAO;EAAa,OAAO;EAAa;CAC1C;EAAE,OAAO;EAAW,OAAO;EAAW;CACtC;EAAE,OAAO;EAAW,OAAO;EAAW;CACtC;EAAE,OAAO;EAAe,OAAO;EAAe;CAC9C;EAAE,OAAO;EAAW,OAAO;EAAW;CACtC;EAAE,OAAO;EAAY,OAAO;EAAY;CACxC;EAAE,OAAO;EAAS,OAAO;EAAS;CACnC,EAEK,IAA0E;CAC9E;EAAE,OAAO;EAAI,OAAO;EAAc;CAClC;EAAE,OAAO;EAAY,OAAO;EAAY;CACxC;EAAE,OAAO;EAAW,OAAO;EAAW;CACtC;EAAE,OAAO;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