@burdenoff/microfe-atheletebridge 2026.830.1 → 2026.1009.1

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.
@@ -2,41 +2,42 @@ import { useAbTranslate as e } from "../../i18n.js";
2
2
  import { useAthleteBridge as t } from "../../context/AthleteBridgeContext.js";
3
3
  import { PageLayout as n } from "../../components/PageLayout.js";
4
4
  import { StatusBadge as r } from "../../components/StatusBadge.js";
5
- import { MEMBER_ROLE_LABELS as i, SPORT_LABELS as ee } from "../../components/domain.js";
6
- import { Crest as te } from "../../components/Crest.js";
7
- import { MatchupRow as a } from "../../components/MatchupRow.js";
8
- import { UserAvatar as ne } from "../../components/UserAvatar.js";
9
- import { EmptyState as o } from "../../components/EmptyState.js";
10
- import { ErrorState as s, LoadingState as c } from "../../components/LoadingState.js";
11
- import { useAddMember as l, useArchiveTeam as re, useRemoveMember as ie, useTeam as ae } from "../../hooks/useAthleteBridgeApi.js";
12
- import { FormField as u, fieldInputClass as d } from "../../components/form.js";
13
- import { UserSearchSelect as oe } from "../../components/UserSearchSelect.js";
14
- import { useState as f } from "react";
15
- import { useMutation as p, useQueryClient as m } from "@tanstack/react-query";
16
- import { Archive as se, ArrowLeft as h, CalendarDays as g, Check as _, Edit as ce, Loader2 as v, MapPin as le, Pencil as ue, Plus as de, Trash2 as y, UserPlus as b, X as x } from "lucide-react";
17
- import { useParams as S } from "react-router";
18
- import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
19
- import { GlassCard as E, ResponsiveDialog as fe, ResponsiveDialogContent as pe, ResponsiveDialogFooter as me, ResponsiveDialogHeader as he, ResponsiveDialogTitle as ge } from "@burdenoff/fe-libs/ui";
20
- import { clearGraphqlFetchResponseCache as D, graphqlFetch as O } from "@burdenoff/fe-libs/shared/graphql";
5
+ import { MEMBER_ROLE_LABELS as i, SPORT_LABELS as a } from "../../components/domain.js";
6
+ import { Crest as o } from "../../components/Crest.js";
7
+ import { MatchupRow as ee } from "../../components/MatchupRow.js";
8
+ import { UserAvatar as te } from "../../components/UserAvatar.js";
9
+ import { EmptyState as s } from "../../components/EmptyState.js";
10
+ import { ErrorState as ne, LoadingState as re } from "../../components/LoadingState.js";
11
+ import { useAddMember as ie, useArchiveTeam as ae, useRemoveMember as oe, useTeam as se } from "../../hooks/useAthleteBridgeApi.js";
12
+ import { FormField as c, fieldInputClass as l } from "../../components/form.js";
13
+ import { UserSearchSelect as ce } from "../../components/UserSearchSelect.js";
14
+ import { useState as u } from "react";
15
+ import { useMutation as d, useQueryClient as f } from "@tanstack/react-query";
16
+ import { Archive as le, ArrowLeft as ue, CalendarDays as de, Check as fe, Edit as pe, Loader2 as p, MapPin as me, Pencil as he, Plus as ge, Trash2 as _e, UserPlus as m, X as ve } from "lucide-react";
17
+ import { useParams as h } from "react-router";
18
+ import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
19
+ import { GlassCard as y, ResponsiveDialog as b, ResponsiveDialogContent as x, ResponsiveDialogFooter as S, ResponsiveDialogHeader as C, ResponsiveDialogTitle as w } from "@burdenoff/fe-libs/ui";
20
+ import { clearGraphqlFetchResponseCache as T, graphqlFetch as E } from "@burdenoff/fe-libs/shared/graphql";
21
+ import { useGlobalUi as ye } from "@burdenoff/fe-libs/shared/providers/shell/GlobalUiProvider";
21
22
  //#region src/atheletebridge/pages/teams/TeamDetailPage.tsx
22
- var k = Object.keys(i), A = [
23
+ var D = Object.keys(i), O = [
23
24
  "TRIAL",
24
25
  "ACTIVE",
25
26
  "INJURED",
26
27
  "SUSPENDED",
27
28
  "RELEASED"
28
- ], j = (e) => e.charAt(0) + e.slice(1).toLowerCase(), M = {
29
+ ], k = (e) => e.charAt(0) + e.slice(1).toLowerCase(), A = {
29
30
  userId: "",
30
31
  displayName: "",
31
32
  role: "PLAYER",
32
33
  status: "ACTIVE",
33
34
  position: "",
34
35
  jerseyNumber: ""
35
- }, N = (e) => {
36
- let n = m(), { apiGatewayUrl: r } = t();
37
- return p({
36
+ }, be = (e) => {
37
+ let n = f(), { apiGatewayUrl: r } = t();
38
+ return d({
38
39
  mutationFn: async ({ id: e, input: t }) => {
39
- let n = await O({
40
+ let n = await E({
40
41
  gateway: "workspace",
41
42
  baseUrl: r,
42
43
  query: "mutation AthUpdateMember($id: ID!, $input: AthUpdateMemberInput!) {\n athUpdateMember(id: $id, input: $input) {\n id teamId displayName role status position jerseyNumber\n }\n }",
@@ -47,7 +48,7 @@ var k = Object.keys(i), A = [
47
48
  workspaceToken: !0
48
49
  });
49
50
  if (n.errors?.length) throw Error(n.errors[0]?.message ?? "Failed to update member.");
50
- if (D(), !n.data) throw Error("Update did not return data.");
51
+ if (T(), !n.data) throw Error("Update did not return data.");
51
52
  return n.data.athUpdateMember;
52
53
  },
53
54
  onSuccess: () => {
@@ -63,153 +64,161 @@ var k = Object.keys(i), A = [
63
64
  }
64
65
  });
65
66
  };
66
- function P() {
67
- let p = e(), { id: m } = S(), { navigateTo: D } = t(), O = ae(m), P = re(), F = l(), I = ie(m), L = N(m), [_e, R] = f(!1), [z, B] = f(M), [V, H] = f(null), [ve, U] = f(null), [W, G] = f(null), [K, q] = f(null);
68
- if (O.isLoading) return /* @__PURE__ */ w(n, {
69
- title: p("atheletebridge.pages.teamDetail.title", "Team"),
70
- children: /* @__PURE__ */ w(c, { label: p("atheletebridge.pages.teamDetail.loading", "Loading team…") })
67
+ function j() {
68
+ let d = e(), { id: f } = h(), { navigateTo: T } = t(), { showToast: E } = ye(), j = se(f), M = ae(), N = ie(), P = oe(f), F = be(f), [I, L] = u(!1), [R, z] = u(A), [B, V] = u(null), [xe, H] = u(null), [U, W] = u(null), [G, K] = u(null), [q, J] = u(null);
69
+ if (j.isLoading) return /* @__PURE__ */ _(n, {
70
+ title: d("atheletebridge.pages.teamDetail.title", "Team"),
71
+ children: /* @__PURE__ */ _(re, { label: d("atheletebridge.pages.teamDetail.loading", "Loading team…") })
71
72
  });
72
- if (O.isError || !O.data) return /* @__PURE__ */ w(n, {
73
- title: p("atheletebridge.pages.teamDetail.title", "Team"),
74
- children: /* @__PURE__ */ w(s, {
75
- title: p("atheletebridge.pages.teamDetail.notFoundTitle", "Team not found"),
76
- message: p("atheletebridge.pages.teamDetail.notFoundMessage", "This team does not exist or you do not have access to it."),
77
- onRetry: () => D("/teams")
73
+ if (j.isError || !j.data) return /* @__PURE__ */ _(n, {
74
+ title: d("atheletebridge.pages.teamDetail.title", "Team"),
75
+ children: /* @__PURE__ */ _(ne, {
76
+ title: d("atheletebridge.pages.teamDetail.notFoundTitle", "Team not found"),
77
+ message: d("atheletebridge.pages.teamDetail.notFoundMessage", "This team does not exist or you do not have access to it."),
78
+ onRetry: () => T("/teams")
78
79
  })
79
80
  });
80
- let J = O.data, Y = J.members?.items ?? [], X = J.fixtures?.items ?? [], Z = [
81
- ee[J.sport],
82
- J.ageGroup ?? void 0,
83
- J.season ?? void 0,
84
- J.homeVenue ?? void 0
85
- ].filter(Boolean), Q = async () => {
86
- m && (await P.mutateAsync(m), D("/teams"));
87
- }, ye = (e) => {
88
- q(null), U(e.id), G({
81
+ let Y = j.data, X = Y.members?.items ?? [], Z = Y.fixtures?.items ?? [], Q = [
82
+ a[Y.sport],
83
+ Y.ageGroup ?? void 0,
84
+ Y.season ?? void 0,
85
+ Y.homeVenue ?? void 0
86
+ ].filter(Boolean), Se = async () => {
87
+ f && (await M.mutateAsync(f), T("/teams"));
88
+ }, Ce = (e) => {
89
+ K(null), H(e.id), W({
89
90
  role: e.role,
90
91
  status: e.status,
91
92
  position: e.position ?? "",
92
93
  jerseyNumber: e.jerseyNumber == null ? "" : String(e.jerseyNumber)
93
94
  });
94
95
  }, $ = () => {
95
- U(null), G(null), q(null);
96
- }, be = async (e) => {
97
- if (!W) return;
98
- q(null);
99
- let t = W.jerseyNumber.trim(), n;
96
+ H(null), W(null), K(null);
97
+ }, we = async (e) => {
98
+ if (!U) return;
99
+ K(null);
100
+ let t = U.jerseyNumber.trim(), n;
100
101
  if (t && (n = Number.parseInt(t, 10), Number.isNaN(n))) {
101
- q("Jersey number must be a number.");
102
+ K("Jersey number must be a number.");
102
103
  return;
103
104
  }
104
105
  try {
105
- await L.mutateAsync({
106
+ await F.mutateAsync({
106
107
  id: e,
107
108
  input: {
108
- role: W.role,
109
- status: W.status,
110
- position: W.position.trim() || void 0,
109
+ role: U.role,
110
+ status: U.status,
111
+ position: U.position.trim() || void 0,
111
112
  jerseyNumber: n
112
113
  }
113
114
  }), $();
114
115
  } catch (e) {
115
- q(e instanceof Error ? e.message : "Failed to update member.");
116
+ K(e instanceof Error ? e.message : "Failed to update member.");
116
117
  }
117
- }, xe = async (e) => {
118
- if (e.preventDefault(), H(null), !m) return;
119
- if (!z.userId.trim() || !z.displayName.trim()) {
120
- H("User ID and display name are required.");
118
+ }, Te = async (e) => {
119
+ if (e.preventDefault(), V(null), !f) return;
120
+ if (!R.userId.trim() || !R.displayName.trim()) {
121
+ V("User ID and display name are required.");
121
122
  return;
122
123
  }
123
- let t = z.jerseyNumber.trim() ? Number.parseInt(z.jerseyNumber, 10) : void 0;
124
+ let t = R.jerseyNumber.trim() ? Number.parseInt(R.jerseyNumber, 10) : void 0;
124
125
  if (t !== void 0 && Number.isNaN(t)) {
125
- H("Jersey number must be a number.");
126
+ V("Jersey number must be a number.");
126
127
  return;
127
128
  }
128
129
  try {
129
- await F.mutateAsync({
130
- teamId: m,
131
- userId: z.userId.trim(),
132
- displayName: z.displayName.trim(),
133
- role: z.role,
134
- status: z.status,
135
- position: z.position.trim() || void 0,
130
+ await N.mutateAsync({
131
+ teamId: f,
132
+ userId: R.userId.trim(),
133
+ displayName: R.displayName.trim(),
134
+ role: R.role,
135
+ status: R.status,
136
+ position: R.position.trim() || void 0,
136
137
  jerseyNumber: t
137
- }), B(M), R(!1);
138
+ }), z(A), L(!1);
138
139
  } catch (e) {
139
- H(e instanceof Error ? e.message : "Failed to add member.");
140
+ V(e instanceof Error ? e.message : "Failed to add member.");
140
141
  }
141
- }, Se = (e) => D(`/teams/${J.id}/athletes/${e}`);
142
- return /* @__PURE__ */ T(n, {
143
- title: J.name,
142
+ }, Ee = (e) => T(`/teams/${Y.id}/athletes/${e}`), De = async () => {
143
+ if (!q) return;
144
+ let e = q.displayName;
145
+ try {
146
+ await P.mutateAsync(q.id), E(d("atheletebridge.pages.teamDetail.memberDeletedToast", "\"{name}\" was removed from the team.").replace("{name}", e), "success"), J(null);
147
+ } catch {
148
+ E(d("atheletebridge.pages.teamDetail.memberDeleteFailedToast", "Failed to remove \"{name}\". Please try again.").replace("{name}", e), "error"), J(null);
149
+ }
150
+ };
151
+ return /* @__PURE__ */ v(n, {
152
+ title: Y.name,
144
153
  gradientTitle: !0,
145
- description: Z.join(" · "),
146
- actions: /* @__PURE__ */ T("div", {
154
+ description: Q.join(" · "),
155
+ actions: /* @__PURE__ */ v("div", {
147
156
  className: "flex flex-wrap items-center gap-2",
148
157
  children: [
149
- /* @__PURE__ */ T("button", {
158
+ /* @__PURE__ */ v("button", {
150
159
  type: "button",
151
- onClick: () => D("/teams"),
160
+ onClick: () => T("/teams"),
152
161
  className: "inline-flex items-center gap-1.5 rounded-lg border border-border-seam px-3 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken",
153
162
  children: [
154
- /* @__PURE__ */ w(h, { className: "h-4 w-4" }),
163
+ /* @__PURE__ */ _(ue, { className: "h-4 w-4" }),
155
164
  " ",
156
- p("atheletebridge.pages.teamDetail.back", "Back")
165
+ d("atheletebridge.pages.teamDetail.back", "Back")
157
166
  ]
158
167
  }),
159
- /* @__PURE__ */ T("button", {
168
+ /* @__PURE__ */ v("button", {
160
169
  type: "button",
161
- onClick: () => D(`/teams/${J.id}/edit`),
170
+ onClick: () => T(`/teams/${Y.id}/edit`),
162
171
  className: "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-semibold text-action-primary-text transition-colors hover:bg-action-primary-bg/90",
163
172
  children: [
164
- /* @__PURE__ */ w(ce, { className: "h-4 w-4" }),
173
+ /* @__PURE__ */ _(pe, { className: "h-4 w-4" }),
165
174
  " ",
166
- p("atheletebridge.pages.teamDetail.edit", "Edit")
175
+ d("atheletebridge.pages.teamDetail.edit", "Edit")
167
176
  ]
168
177
  }),
169
- J.status !== "ARCHIVED" && /* @__PURE__ */ T("button", {
178
+ Y.status !== "ARCHIVED" && /* @__PURE__ */ v("button", {
170
179
  type: "button",
171
- onClick: Q,
172
- disabled: P.isPending,
180
+ onClick: Se,
181
+ disabled: M.isPending,
173
182
  className: "inline-flex items-center gap-1.5 rounded-lg border border-border-seam px-3 py-2 text-sm font-medium text-status-error-text transition-colors hover:bg-status-error-bg-subtle disabled:opacity-60",
174
183
  children: [
175
- P.isPending ? /* @__PURE__ */ w(v, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ w(se, { className: "h-4 w-4" }),
184
+ M.isPending ? /* @__PURE__ */ _(p, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ _(le, { className: "h-4 w-4" }),
176
185
  " ",
177
- p("atheletebridge.pages.teamDetail.archive", "Archive")
186
+ d("atheletebridge.pages.teamDetail.archive", "Archive")
178
187
  ]
179
188
  })
180
189
  ]
181
190
  }),
182
191
  children: [
183
- /* @__PURE__ */ T(E, {
192
+ /* @__PURE__ */ v(y, {
184
193
  treatment: "insight",
185
194
  className: "mb-8 p-6",
186
195
  children: [
187
- /* @__PURE__ */ T("div", {
196
+ /* @__PURE__ */ v("div", {
188
197
  className: "flex flex-col gap-4 sm:flex-row sm:items-center",
189
- children: [/* @__PURE__ */ w(te, {
190
- name: J.name,
191
- sport: J.sport,
198
+ children: [/* @__PURE__ */ _(o, {
199
+ name: Y.name,
200
+ sport: Y.sport,
192
201
  size: 64
193
- }), /* @__PURE__ */ T("div", {
202
+ }), /* @__PURE__ */ v("div", {
194
203
  className: "min-w-0 flex-1",
195
- children: [/* @__PURE__ */ T("div", {
204
+ children: [/* @__PURE__ */ v("div", {
196
205
  className: "flex flex-wrap items-center gap-3",
197
- children: [/* @__PURE__ */ w("h2", {
206
+ children: [/* @__PURE__ */ _("h2", {
198
207
  className: "text-xl font-semibold text-text-primary",
199
- children: J.name
200
- }), /* @__PURE__ */ w(r, { status: J.status })]
201
- }), /* @__PURE__ */ w("div", {
208
+ children: Y.name
209
+ }), /* @__PURE__ */ _(r, { status: Y.status })]
210
+ }), /* @__PURE__ */ _("div", {
202
211
  className: "mt-1.5 flex flex-wrap items-center gap-x-2 gap-y-1 text-sm text-text-secondary",
203
- children: Z.map((e, t) => /* @__PURE__ */ T("span", {
212
+ children: Q.map((e, t) => /* @__PURE__ */ v("span", {
204
213
  className: "flex items-center gap-2",
205
- children: [t > 0 && /* @__PURE__ */ w("span", {
214
+ children: [t > 0 && /* @__PURE__ */ _("span", {
206
215
  "aria-hidden": "true",
207
216
  className: "text-text-muted",
208
217
  children: "·"
209
- }), e === J.homeVenue ? /* @__PURE__ */ T("span", {
218
+ }), e === Y.homeVenue ? /* @__PURE__ */ v("span", {
210
219
  className: "flex items-center gap-1",
211
220
  children: [
212
- /* @__PURE__ */ w(le, {
221
+ /* @__PURE__ */ _(me, {
213
222
  className: "h-3.5 w-3.5",
214
223
  "aria-hidden": "true"
215
224
  }),
@@ -221,213 +230,213 @@ function P() {
221
230
  })]
222
231
  })]
223
232
  }),
224
- J.description && /* @__PURE__ */ w("p", {
233
+ Y.description && /* @__PURE__ */ _("p", {
225
234
  className: "mt-4 text-sm text-text-secondary",
226
- children: J.description
235
+ children: Y.description
227
236
  }),
228
- J.tags.length > 0 && /* @__PURE__ */ w("div", {
237
+ Y.tags.length > 0 && /* @__PURE__ */ _("div", {
229
238
  className: "mt-4 flex flex-wrap gap-1.5",
230
- children: J.tags.map((e) => /* @__PURE__ */ w("span", {
239
+ children: Y.tags.map((e) => /* @__PURE__ */ _("span", {
231
240
  className: "inline-flex items-center rounded-full bg-bg-sunken px-2 py-0.5 text-xs text-text-secondary",
232
241
  children: e
233
242
  }, e))
234
243
  })
235
244
  ]
236
245
  }),
237
- /* @__PURE__ */ T("section", {
246
+ /* @__PURE__ */ v("section", {
238
247
  className: "mb-8",
239
- children: [/* @__PURE__ */ T("div", {
248
+ children: [/* @__PURE__ */ v("div", {
240
249
  className: "mb-4 flex items-center justify-between",
241
- children: [/* @__PURE__ */ T("h2", {
250
+ children: [/* @__PURE__ */ v("h2", {
242
251
  className: "text-lg font-semibold text-text-primary",
243
252
  children: [
244
- p("atheletebridge.pages.teamDetail.rosterTitle", "Roster"),
253
+ d("atheletebridge.pages.teamDetail.rosterTitle", "Roster"),
245
254
  " (",
246
- Y.length,
255
+ X.length,
247
256
  ")"
248
257
  ]
249
- }), /* @__PURE__ */ T("button", {
258
+ }), /* @__PURE__ */ v("button", {
250
259
  type: "button",
251
260
  onClick: () => {
252
- H(null), R(!0);
261
+ V(null), L(!0);
253
262
  },
254
263
  className: "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-3 py-1.5 text-sm font-semibold text-action-primary-text transition-colors hover:bg-action-primary-bg/90",
255
264
  children: [
256
- /* @__PURE__ */ w(b, { className: "h-4 w-4" }),
265
+ /* @__PURE__ */ _(m, { className: "h-4 w-4" }),
257
266
  " ",
258
- p("atheletebridge.pages.teamDetail.addMember", "Add member")
267
+ d("atheletebridge.pages.teamDetail.addMember", "Add member")
259
268
  ]
260
269
  })]
261
- }), Y.length === 0 ? /* @__PURE__ */ w(o, {
270
+ }), X.length === 0 ? /* @__PURE__ */ _(s, {
262
271
  illustration: "empty-data",
263
- icon: /* @__PURE__ */ w(b, { className: "h-10 w-10" }),
264
- title: p("atheletebridge.pages.teamDetail.noMembersTitle", "No members yet"),
265
- description: p("atheletebridge.pages.teamDetail.noMembersHint", "Add players, coaches and staff to build the roster.")
266
- }) : /* @__PURE__ */ T(E, {
272
+ icon: /* @__PURE__ */ _(m, { className: "h-10 w-10" }),
273
+ title: d("atheletebridge.pages.teamDetail.noMembersTitle", "No members yet"),
274
+ description: d("atheletebridge.pages.teamDetail.noMembersHint", "Add players, coaches and staff to build the roster.")
275
+ }) : /* @__PURE__ */ v(y, {
267
276
  treatment: "insight",
268
277
  className: "overflow-hidden p-0",
269
- children: [/* @__PURE__ */ w("div", {
278
+ children: [/* @__PURE__ */ _("div", {
270
279
  className: "overflow-x-auto",
271
- children: /* @__PURE__ */ T("table", {
280
+ children: /* @__PURE__ */ v("table", {
272
281
  className: "w-full min-w-[720px] border-collapse text-sm",
273
- children: [/* @__PURE__ */ w("thead", { children: /* @__PURE__ */ T("tr", {
282
+ children: [/* @__PURE__ */ _("thead", { children: /* @__PURE__ */ v("tr", {
274
283
  className: "border-b border-border-seam text-left text-xs uppercase tracking-wide text-text-secondary",
275
284
  children: [
276
- /* @__PURE__ */ w("th", {
285
+ /* @__PURE__ */ _("th", {
277
286
  className: "px-4 py-3 font-medium",
278
- children: p("atheletebridge.pages.teamDetail.playerHeader", "Player")
287
+ children: d("atheletebridge.pages.teamDetail.playerHeader", "Player")
279
288
  }),
280
- /* @__PURE__ */ w("th", {
289
+ /* @__PURE__ */ _("th", {
281
290
  className: "px-4 py-3 font-medium",
282
- children: p("atheletebridge.pages.teamDetail.roleHeader", "Role")
291
+ children: d("atheletebridge.pages.teamDetail.roleHeader", "Role")
283
292
  }),
284
- /* @__PURE__ */ w("th", {
293
+ /* @__PURE__ */ _("th", {
285
294
  className: "px-4 py-3 font-medium",
286
- children: p("atheletebridge.pages.teamDetail.positionHeader", "Position")
295
+ children: d("atheletebridge.pages.teamDetail.positionHeader", "Position")
287
296
  }),
288
- /* @__PURE__ */ w("th", {
297
+ /* @__PURE__ */ _("th", {
289
298
  className: "px-4 py-3 font-medium",
290
- children: p("atheletebridge.pages.teamDetail.jerseyHeader", "Jersey #")
299
+ children: d("atheletebridge.pages.teamDetail.jerseyHeader", "Jersey #")
291
300
  }),
292
- /* @__PURE__ */ w("th", {
301
+ /* @__PURE__ */ _("th", {
293
302
  className: "px-4 py-3 font-medium",
294
- children: p("atheletebridge.pages.teamDetail.statusHeader", "Status")
303
+ children: d("atheletebridge.pages.teamDetail.statusHeader", "Status")
295
304
  }),
296
- /* @__PURE__ */ w("th", {
305
+ /* @__PURE__ */ _("th", {
297
306
  className: "px-4 py-3 text-right font-medium",
298
- children: p("atheletebridge.pages.teamDetail.actionsHeader", "Actions")
307
+ children: d("atheletebridge.pages.teamDetail.actionsHeader", "Actions")
299
308
  })
300
309
  ]
301
- }) }), /* @__PURE__ */ w("tbody", {
310
+ }) }), /* @__PURE__ */ _("tbody", {
302
311
  className: "divide-y divide-border-seam",
303
- children: Y.map((e) => {
304
- let t = ve === e.id, n = L.isPending && t;
305
- return /* @__PURE__ */ T("tr", {
312
+ children: X.map((e) => {
313
+ let t = xe === e.id, n = F.isPending && t;
314
+ return /* @__PURE__ */ v("tr", {
306
315
  className: "align-middle transition-colors hover:bg-bg-sunken/60",
307
316
  children: [
308
- /* @__PURE__ */ w("td", {
317
+ /* @__PURE__ */ _("td", {
309
318
  className: "px-4 py-3",
310
- children: /* @__PURE__ */ T("button", {
319
+ children: /* @__PURE__ */ v("button", {
311
320
  type: "button",
312
- onClick: () => Se(e.id),
321
+ onClick: () => Ee(e.id),
313
322
  className: "group flex items-center gap-3 text-left focus-visible:outline-none",
314
- title: `${p("atheletebridge.pages.teamDetail.viewProfile", "View profile")}: ${e.displayName}`,
315
- children: [/* @__PURE__ */ w(ne, {
323
+ title: `${d("atheletebridge.pages.teamDetail.viewProfile", "View profile")}: ${e.displayName}`,
324
+ children: [/* @__PURE__ */ _(te, {
316
325
  name: e.displayName,
317
326
  id: e.userId,
318
327
  jersey: e.jerseyNumber,
319
328
  size: "sm"
320
- }), /* @__PURE__ */ T("span", {
329
+ }), /* @__PURE__ */ v("span", {
321
330
  className: "min-w-0",
322
- children: [/* @__PURE__ */ w("span", {
331
+ children: [/* @__PURE__ */ _("span", {
323
332
  className: "block truncate font-medium text-text-primary group-hover:text-text-link",
324
333
  children: e.displayName
325
- }), /* @__PURE__ */ w("span", {
334
+ }), /* @__PURE__ */ _("span", {
326
335
  className: "block truncate text-xs text-text-secondary group-hover:text-text-link",
327
- children: p("atheletebridge.pages.teamDetail.viewProfile", "View profile")
336
+ children: d("atheletebridge.pages.teamDetail.viewProfile", "View profile")
328
337
  })]
329
338
  })]
330
339
  })
331
340
  }),
332
- /* @__PURE__ */ w("td", {
341
+ /* @__PURE__ */ _("td", {
333
342
  className: "px-4 py-3",
334
- children: t && W ? /* @__PURE__ */ w("select", {
335
- "aria-label": p("atheletebridge.pages.teamDetail.roleHeader", "Role"),
336
- className: d,
337
- value: W.role,
338
- onChange: (e) => G((t) => t && {
343
+ children: t && U ? /* @__PURE__ */ _("select", {
344
+ "aria-label": d("atheletebridge.pages.teamDetail.roleHeader", "Role"),
345
+ className: l,
346
+ value: U.role,
347
+ onChange: (e) => W((t) => t && {
339
348
  ...t,
340
349
  role: e.target.value
341
350
  }),
342
- children: k.map((e) => /* @__PURE__ */ w("option", {
351
+ children: D.map((e) => /* @__PURE__ */ _("option", {
343
352
  value: e,
344
353
  children: i[e]
345
354
  }, e))
346
- }) : /* @__PURE__ */ w("span", {
355
+ }) : /* @__PURE__ */ _("span", {
347
356
  className: "text-text-secondary",
348
357
  children: i[e.role]
349
358
  })
350
359
  }),
351
- /* @__PURE__ */ w("td", {
360
+ /* @__PURE__ */ _("td", {
352
361
  className: "px-4 py-3",
353
- children: t && W ? /* @__PURE__ */ w("input", {
354
- "aria-label": p("atheletebridge.pages.teamDetail.positionHeader", "Position"),
355
- className: d,
356
- value: W.position,
357
- onChange: (e) => G((t) => t && {
362
+ children: t && U ? /* @__PURE__ */ _("input", {
363
+ "aria-label": d("atheletebridge.pages.teamDetail.positionHeader", "Position"),
364
+ className: l,
365
+ value: U.position,
366
+ onChange: (e) => W((t) => t && {
358
367
  ...t,
359
368
  position: e.target.value
360
369
  }),
361
370
  placeholder: "e.g. Striker"
362
- }) : /* @__PURE__ */ w("span", {
371
+ }) : /* @__PURE__ */ _("span", {
363
372
  className: "text-text-secondary",
364
373
  children: e.position || "—"
365
374
  })
366
375
  }),
367
- /* @__PURE__ */ w("td", {
376
+ /* @__PURE__ */ _("td", {
368
377
  className: "px-4 py-3",
369
- children: t && W ? /* @__PURE__ */ w("input", {
370
- "aria-label": p("atheletebridge.pages.teamDetail.jerseyHeader", "Jersey number"),
378
+ children: t && U ? /* @__PURE__ */ _("input", {
379
+ "aria-label": d("atheletebridge.pages.teamDetail.jerseyHeader", "Jersey number"),
371
380
  inputMode: "numeric",
372
- className: `${d} w-20`,
373
- value: W.jerseyNumber,
374
- onChange: (e) => G((t) => t && {
381
+ className: `${l} w-20`,
382
+ value: U.jerseyNumber,
383
+ onChange: (e) => W((t) => t && {
375
384
  ...t,
376
385
  jerseyNumber: e.target.value
377
386
  }),
378
387
  placeholder: "9"
379
- }) : /* @__PURE__ */ w("span", {
388
+ }) : /* @__PURE__ */ _("span", {
380
389
  className: "tabular-nums text-text-primary",
381
390
  children: e.jerseyNumber ?? "—"
382
391
  })
383
392
  }),
384
- /* @__PURE__ */ w("td", {
393
+ /* @__PURE__ */ _("td", {
385
394
  className: "px-4 py-3",
386
- children: t && W ? /* @__PURE__ */ w("select", {
387
- "aria-label": p("atheletebridge.pages.teamDetail.statusHeader", "Status"),
388
- className: d,
389
- value: W.status,
390
- onChange: (e) => G((t) => t && {
395
+ children: t && U ? /* @__PURE__ */ _("select", {
396
+ "aria-label": d("atheletebridge.pages.teamDetail.statusHeader", "Status"),
397
+ className: l,
398
+ value: U.status,
399
+ onChange: (e) => W((t) => t && {
391
400
  ...t,
392
401
  status: e.target.value
393
402
  }),
394
- children: A.map((e) => /* @__PURE__ */ w("option", {
403
+ children: O.map((e) => /* @__PURE__ */ _("option", {
395
404
  value: e,
396
- children: j(e)
405
+ children: k(e)
397
406
  }, e))
398
- }) : /* @__PURE__ */ w(r, { status: e.status })
407
+ }) : /* @__PURE__ */ _(r, { status: e.status })
399
408
  }),
400
- /* @__PURE__ */ w("td", {
409
+ /* @__PURE__ */ _("td", {
401
410
  className: "px-4 py-3",
402
- children: /* @__PURE__ */ w("div", {
411
+ children: /* @__PURE__ */ _("div", {
403
412
  className: "flex items-center justify-end gap-1",
404
- children: t ? /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w("button", {
413
+ children: t ? /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("button", {
405
414
  type: "button",
406
- onClick: () => void be(e.id),
415
+ onClick: () => void we(e.id),
407
416
  disabled: n,
408
- "aria-label": p("common.save", "Save"),
417
+ "aria-label": d("common.save", "Save"),
409
418
  className: "rounded-lg p-2 text-status-success-text transition-colors hover:bg-status-success-bg-subtle disabled:opacity-60",
410
- children: n ? /* @__PURE__ */ w(v, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ w(_, { className: "h-4 w-4" })
411
- }), /* @__PURE__ */ w("button", {
419
+ children: n ? /* @__PURE__ */ _(p, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ _(fe, { className: "h-4 w-4" })
420
+ }), /* @__PURE__ */ _("button", {
412
421
  type: "button",
413
422
  onClick: $,
414
423
  disabled: n,
415
- "aria-label": p("common.cancel", "Cancel"),
424
+ "aria-label": d("common.cancel", "Cancel"),
416
425
  className: "rounded-lg p-2 text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary disabled:opacity-60",
417
- children: /* @__PURE__ */ w(x, { className: "h-4 w-4" })
418
- })] }) : /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w("button", {
426
+ children: /* @__PURE__ */ _(ve, { className: "h-4 w-4" })
427
+ })] }) : /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("button", {
419
428
  type: "button",
420
- onClick: () => ye(e),
421
- "aria-label": `${p("common.edit", "Edit")} ${e.displayName}`,
429
+ onClick: () => Ce(e),
430
+ "aria-label": `${d("common.edit", "Edit")} ${e.displayName}`,
422
431
  className: "rounded-lg p-2 text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary",
423
- children: /* @__PURE__ */ w(ue, { className: "h-4 w-4" })
424
- }), /* @__PURE__ */ w("button", {
432
+ children: /* @__PURE__ */ _(he, { className: "h-4 w-4" })
433
+ }), /* @__PURE__ */ _("button", {
425
434
  type: "button",
426
- onClick: () => void I.mutate(e.id),
427
- disabled: I.isPending,
428
- "aria-label": `${p("common.delete", "Delete")} ${e.displayName}`,
435
+ onClick: () => J(e),
436
+ disabled: P.isPending,
437
+ "aria-label": `${d("common.delete", "Delete")} ${e.displayName}`,
429
438
  className: "rounded-lg p-2 text-text-secondary transition-colors hover:bg-status-error-bg-subtle hover:text-status-error-text disabled:opacity-60",
430
- children: /* @__PURE__ */ w(y, { className: "h-4 w-4" })
439
+ children: /* @__PURE__ */ _(_e, { className: "h-4 w-4" })
431
440
  })] })
432
441
  })
433
442
  })
@@ -436,148 +445,174 @@ function P() {
436
445
  })
437
446
  })]
438
447
  })
439
- }), K && /* @__PURE__ */ w("p", {
448
+ }), G && /* @__PURE__ */ _("p", {
440
449
  className: "border-t border-border-seam px-4 py-2 text-sm text-status-error-text",
441
- children: K
450
+ children: G
442
451
  })]
443
452
  })]
444
453
  }),
445
- /* @__PURE__ */ T("section", { children: [/* @__PURE__ */ T("div", {
454
+ /* @__PURE__ */ v("section", { children: [/* @__PURE__ */ v("div", {
446
455
  className: "mb-4 flex items-center justify-between",
447
- children: [/* @__PURE__ */ T("h2", {
456
+ children: [/* @__PURE__ */ v("h2", {
448
457
  className: "text-lg font-semibold text-text-primary",
449
458
  children: [
450
- p("atheletebridge.pages.teamDetail.fixturesTitle", "Fixtures"),
459
+ d("atheletebridge.pages.teamDetail.fixturesTitle", "Fixtures"),
451
460
  " (",
452
- X.length,
461
+ Z.length,
453
462
  ")"
454
463
  ]
455
- }), /* @__PURE__ */ T("div", {
464
+ }), /* @__PURE__ */ v("div", {
456
465
  className: "flex items-center gap-2",
457
- children: [X.length > 0 && /* @__PURE__ */ w("button", {
466
+ children: [Z.length > 0 && /* @__PURE__ */ _("button", {
458
467
  type: "button",
459
- onClick: () => D("/fixtures"),
468
+ onClick: () => T("/fixtures"),
460
469
  className: "text-sm font-medium text-text-link transition-colors hover:underline",
461
- children: p("atheletebridge.pages.teamDetail.viewAll", "View all")
462
- }), /* @__PURE__ */ T("button", {
470
+ children: d("atheletebridge.pages.teamDetail.viewAll", "View all")
471
+ }), /* @__PURE__ */ v("button", {
463
472
  type: "button",
464
- onClick: () => D(`/fixtures/new?homeTeamId=${J.id}`),
473
+ onClick: () => T(`/fixtures/new?homeTeamId=${Y.id}`),
465
474
  className: "inline-flex items-center gap-1.5 rounded-lg border border-border-seam px-3 py-1.5 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken",
466
475
  children: [
467
- /* @__PURE__ */ w(de, { className: "h-4 w-4" }),
476
+ /* @__PURE__ */ _(ge, { className: "h-4 w-4" }),
468
477
  " ",
469
- p("atheletebridge.pages.teamDetail.schedule", "Schedule")
478
+ d("atheletebridge.pages.teamDetail.schedule", "Schedule")
470
479
  ]
471
480
  })]
472
481
  })]
473
- }), X.length === 0 ? /* @__PURE__ */ w(o, {
482
+ }), Z.length === 0 ? /* @__PURE__ */ _(s, {
474
483
  illustration: "empty-calendar",
475
- icon: /* @__PURE__ */ w(g, { className: "h-10 w-10" }),
476
- title: p("atheletebridge.pages.teamDetail.noFixturesTitle", "No fixtures scheduled"),
477
- description: p("atheletebridge.pages.teamDetail.noFixturesHint", "Schedule a match for this team to start tracking results.")
478
- }) : /* @__PURE__ */ w(E, {
484
+ icon: /* @__PURE__ */ _(de, { className: "h-10 w-10" }),
485
+ title: d("atheletebridge.pages.teamDetail.noFixturesTitle", "No fixtures scheduled"),
486
+ description: d("atheletebridge.pages.teamDetail.noFixturesHint", "Schedule a match for this team to start tracking results.")
487
+ }) : /* @__PURE__ */ _(y, {
479
488
  treatment: "insight",
480
489
  className: "px-4 py-1",
481
- children: /* @__PURE__ */ w("div", {
490
+ children: /* @__PURE__ */ _("div", {
482
491
  className: "divide-y divide-border-seam",
483
- children: X.map((e) => /* @__PURE__ */ w(a, {
492
+ children: Z.map((e) => /* @__PURE__ */ _(ee, {
484
493
  fixture: e,
485
- onClick: () => D(`/fixtures/${e.id}`)
494
+ onClick: () => T(`/fixtures/${e.id}`)
486
495
  }, e.id))
487
496
  })
488
497
  })] }),
489
- /* @__PURE__ */ w(fe, {
490
- open: _e,
491
- onOpenChange: R,
492
- children: /* @__PURE__ */ T(pe, { children: [/* @__PURE__ */ w(he, { children: /* @__PURE__ */ w(ge, { children: p("atheletebridge.pages.teamDetail.addMember", "Add member") }) }), /* @__PURE__ */ T("form", {
493
- onSubmit: xe,
498
+ /* @__PURE__ */ _(b, {
499
+ open: q !== null,
500
+ onOpenChange: (e) => {
501
+ !e && !P.isPending && J(null);
502
+ },
503
+ children: /* @__PURE__ */ v(x, { children: [
504
+ /* @__PURE__ */ _(C, { children: /* @__PURE__ */ _(w, { children: d("atheletebridge.pages.teamDetail.deleteMemberTitle", "Delete player?") }) }),
505
+ /* @__PURE__ */ _("p", {
506
+ className: "px-1 text-sm text-text-secondary",
507
+ children: d("atheletebridge.pages.teamDetail.deleteMemberMessage", "This will remove \"{name}\" from {team}. This action cannot be undone.").replace("{name}", q?.displayName ?? "").replace("{team}", Y.name)
508
+ }),
509
+ /* @__PURE__ */ v(S, { children: [/* @__PURE__ */ _("button", {
510
+ type: "button",
511
+ onClick: () => J(null),
512
+ disabled: P.isPending,
513
+ className: "rounded-lg border border-border-seam px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken disabled:opacity-60",
514
+ children: d("common.cancel", "Cancel")
515
+ }), /* @__PURE__ */ v("button", {
516
+ type: "button",
517
+ onClick: () => void De(),
518
+ disabled: P.isPending,
519
+ className: "inline-flex items-center gap-1.5 rounded-lg bg-action-danger-bg px-4 py-2 text-sm font-semibold text-action-danger-text transition-colors hover:bg-action-danger-bgHover disabled:opacity-60",
520
+ children: [P.isPending && /* @__PURE__ */ _(p, { className: "h-4 w-4 animate-spin" }), d("common.delete", "Delete")]
521
+ })] })
522
+ ] })
523
+ }),
524
+ /* @__PURE__ */ _(b, {
525
+ open: I,
526
+ onOpenChange: L,
527
+ children: /* @__PURE__ */ v(x, { children: [/* @__PURE__ */ _(C, { children: /* @__PURE__ */ _(w, { children: d("atheletebridge.pages.teamDetail.addMember", "Add member") }) }), /* @__PURE__ */ v("form", {
528
+ onSubmit: Te,
494
529
  className: "space-y-4 px-1",
495
530
  children: [
496
- /* @__PURE__ */ w(oe, {
497
- userId: z.userId,
498
- displayName: z.displayName,
499
- onSelect: ({ userId: e, displayName: t }) => B((n) => ({
531
+ /* @__PURE__ */ _(ce, {
532
+ userId: R.userId,
533
+ displayName: R.displayName,
534
+ onSelect: ({ userId: e, displayName: t }) => z((n) => ({
500
535
  ...n,
501
536
  userId: e,
502
537
  displayName: t || n.displayName
503
538
  })),
504
539
  required: !0
505
540
  }),
506
- /* @__PURE__ */ w(u, {
541
+ /* @__PURE__ */ _(c, {
507
542
  label: "Display name",
508
543
  htmlFor: "displayName",
509
544
  required: !0,
510
- children: /* @__PURE__ */ w("input", {
545
+ children: /* @__PURE__ */ _("input", {
511
546
  id: "displayName",
512
- className: d,
513
- value: z.displayName,
514
- onChange: (e) => B((t) => ({
547
+ className: l,
548
+ value: R.displayName,
549
+ onChange: (e) => z((t) => ({
515
550
  ...t,
516
551
  displayName: e.target.value
517
552
  })),
518
553
  placeholder: "e.g. Alex Morgan"
519
554
  })
520
555
  }),
521
- /* @__PURE__ */ T("div", {
556
+ /* @__PURE__ */ v("div", {
522
557
  className: "grid grid-cols-2 gap-4",
523
- children: [/* @__PURE__ */ w(u, {
558
+ children: [/* @__PURE__ */ _(c, {
524
559
  label: "Role",
525
560
  htmlFor: "role",
526
- children: /* @__PURE__ */ w("select", {
561
+ children: /* @__PURE__ */ _("select", {
527
562
  id: "role",
528
- className: d,
529
- value: z.role,
530
- onChange: (e) => B((t) => ({
563
+ className: l,
564
+ value: R.role,
565
+ onChange: (e) => z((t) => ({
531
566
  ...t,
532
567
  role: e.target.value
533
568
  })),
534
- children: k.map((e) => /* @__PURE__ */ w("option", {
569
+ children: D.map((e) => /* @__PURE__ */ _("option", {
535
570
  value: e,
536
571
  children: i[e]
537
572
  }, e))
538
573
  })
539
- }), /* @__PURE__ */ w(u, {
574
+ }), /* @__PURE__ */ _(c, {
540
575
  label: "Status",
541
576
  htmlFor: "memberStatus",
542
- children: /* @__PURE__ */ w("select", {
577
+ children: /* @__PURE__ */ _("select", {
543
578
  id: "memberStatus",
544
- className: d,
545
- value: z.status,
546
- onChange: (e) => B((t) => ({
579
+ className: l,
580
+ value: R.status,
581
+ onChange: (e) => z((t) => ({
547
582
  ...t,
548
583
  status: e.target.value
549
584
  })),
550
- children: A.map((e) => /* @__PURE__ */ w("option", {
585
+ children: O.map((e) => /* @__PURE__ */ _("option", {
551
586
  value: e,
552
- children: j(e)
587
+ children: k(e)
553
588
  }, e))
554
589
  })
555
590
  })]
556
591
  }),
557
- /* @__PURE__ */ T("div", {
592
+ /* @__PURE__ */ v("div", {
558
593
  className: "grid grid-cols-2 gap-4",
559
- children: [/* @__PURE__ */ w(u, {
594
+ children: [/* @__PURE__ */ _(c, {
560
595
  label: "Position",
561
596
  htmlFor: "position",
562
- children: /* @__PURE__ */ w("input", {
597
+ children: /* @__PURE__ */ _("input", {
563
598
  id: "position",
564
- className: d,
565
- value: z.position,
566
- onChange: (e) => B((t) => ({
599
+ className: l,
600
+ value: R.position,
601
+ onChange: (e) => z((t) => ({
567
602
  ...t,
568
603
  position: e.target.value
569
604
  })),
570
605
  placeholder: "e.g. Striker"
571
606
  })
572
- }), /* @__PURE__ */ w(u, {
607
+ }), /* @__PURE__ */ _(c, {
573
608
  label: "Jersey #",
574
609
  htmlFor: "jersey",
575
- children: /* @__PURE__ */ w("input", {
610
+ children: /* @__PURE__ */ _("input", {
576
611
  id: "jersey",
577
- className: d,
612
+ className: l,
578
613
  inputMode: "numeric",
579
- value: z.jerseyNumber,
580
- onChange: (e) => B((t) => ({
614
+ value: R.jerseyNumber,
615
+ onChange: (e) => z((t) => ({
581
616
  ...t,
582
617
  jerseyNumber: e.target.value
583
618
  })),
@@ -585,20 +620,20 @@ function P() {
585
620
  })
586
621
  })]
587
622
  }),
588
- V && /* @__PURE__ */ w("p", {
623
+ B && /* @__PURE__ */ _("p", {
589
624
  className: "text-sm text-status-error-text",
590
- children: V
625
+ children: B
591
626
  }),
592
- /* @__PURE__ */ T(me, { children: [/* @__PURE__ */ w("button", {
627
+ /* @__PURE__ */ v(S, { children: [/* @__PURE__ */ _("button", {
593
628
  type: "button",
594
- onClick: () => R(!1),
629
+ onClick: () => L(!1),
595
630
  className: "rounded-lg border border-border-seam px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken",
596
- children: p("common.cancel", "Cancel")
597
- }), /* @__PURE__ */ T("button", {
631
+ children: d("common.cancel", "Cancel")
632
+ }), /* @__PURE__ */ v("button", {
598
633
  type: "submit",
599
- disabled: F.isPending,
634
+ disabled: N.isPending,
600
635
  className: "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-semibold text-action-primary-text transition-colors hover:bg-action-primary-bg/90 disabled:opacity-60",
601
- children: [F.isPending && /* @__PURE__ */ w(v, { className: "h-4 w-4 animate-spin" }), p("atheletebridge.pages.teamDetail.addMember", "Add member")]
636
+ children: [N.isPending && /* @__PURE__ */ _(p, { className: "h-4 w-4 animate-spin" }), d("atheletebridge.pages.teamDetail.addMember", "Add member")]
602
637
  })] })
603
638
  ]
604
639
  })] })
@@ -607,6 +642,6 @@ function P() {
607
642
  });
608
643
  }
609
644
  //#endregion
610
- export { P as TeamDetailPage };
645
+ export { j as TeamDetailPage };
611
646
 
612
647
  //# sourceMappingURL=TeamDetailPage.js.map