@burdenoff/microfe-atheletebridge 2026.1102.1 → 2026.1103.2
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/atheletebridge/hooks/useAthleteBridgeApi.d.ts +11 -1
- package/dist/atheletebridge/hooks/useAthleteBridgeApi.d.ts.map +1 -1
- package/dist/atheletebridge/hooks/useAthleteBridgeApi.js +109 -49
- package/dist/atheletebridge/hooks/useAthleteBridgeApi.js.map +1 -1
- package/dist/atheletebridge/pages/fixtures/FixtureDetailPage.d.ts +3 -1
- package/dist/atheletebridge/pages/fixtures/FixtureDetailPage.d.ts.map +1 -1
- package/dist/atheletebridge/pages/fixtures/FixtureDetailPage.js +278 -123
- package/dist/atheletebridge/pages/fixtures/FixtureDetailPage.js.map +1 -1
- package/dist/atheletebridge/pages/teams/TeamDetailPage.d.ts.map +1 -1
- package/dist/atheletebridge/pages/teams/TeamDetailPage.js +308 -287
- package/dist/atheletebridge/pages/teams/TeamDetailPage.js.map +1 -1
- package/dist/atheletebridge/types/index.d.ts +13 -0
- package/dist/atheletebridge/types/index.d.ts.map +1 -1
- package/dist/atheletebridge/utils/datetime.js +8 -1
- package/dist/atheletebridge/utils/datetime.js.map +1 -1
- package/dist/atheletebridge/utils/fixtureLifecycle.d.ts +38 -0
- package/dist/atheletebridge/utils/fixtureLifecycle.d.ts.map +1 -0
- package/dist/atheletebridge/utils/fixtureLifecycle.js +30 -0
- package/dist/atheletebridge/utils/fixtureLifecycle.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,25 +1,27 @@
|
|
|
1
1
|
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
|
-
import { FIXTURE_TYPE_LABELS as
|
|
5
|
-
import { Crest as
|
|
6
|
-
import { Scoreboard as
|
|
7
|
-
import { ErrorState as
|
|
8
|
-
import { useFixture as
|
|
9
|
-
import { useScheduledTimeGate as
|
|
4
|
+
import { FIXTURE_TYPE_LABELS as ee } from "../../components/domain.js";
|
|
5
|
+
import { Crest as r } from "../../components/Crest.js";
|
|
6
|
+
import { Scoreboard as te } from "../../components/Scoreboard.js";
|
|
7
|
+
import { ErrorState as ne, LoadingState as re } from "../../components/LoadingState.js";
|
|
8
|
+
import { useCancelFixture as ie, useFixture as ae, usePostponeFixture as oe, useRecordFixtureResult as se, useUpdateFixture as ce } from "../../hooks/useAthleteBridgeApi.js";
|
|
9
|
+
import { useScheduledTimeGate as le } from "../../hooks/useScheduledTimeGate.js";
|
|
10
10
|
import "../../hooks/index.js";
|
|
11
|
-
import { FormField as
|
|
12
|
-
import { AvailabilityRsvpControl as
|
|
13
|
-
import { AvailabilityRosterPanel as
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
11
|
+
import { FormField as i, fieldInputClass as a } from "../../components/form.js";
|
|
12
|
+
import { AvailabilityRsvpControl as ue } from "../../components/availability/AvailabilityRsvpControl.js";
|
|
13
|
+
import { AvailabilityRosterPanel as de } from "../../components/availability/AvailabilityRosterPanel.js";
|
|
14
|
+
import { buildScheduleInput as fe, getFixtureLifecycleActions as pe, initialScheduleInputs as me } from "../../utils/fixtureLifecycle.js";
|
|
15
|
+
import { buildRecordResultInput as he, parseScoreInput as o } from "../../utils/recordResult.js";
|
|
16
|
+
import { useState as s } from "react";
|
|
17
|
+
import { ArrowLeft as ge, Ban as _e, CalendarClock as c, CalendarPlus as ve, Flag as ye, Loader2 as l, Minus as be, Trophy as u } from "lucide-react";
|
|
18
|
+
import { useParams as xe } from "react-router";
|
|
19
|
+
import { Fragment as Se, jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
20
|
+
import { EmphasisPanel as p, GlassCard as m, ResponsiveDialog as h, ResponsiveDialogContent as g, ResponsiveDialogFooter as _, ResponsiveDialogHeader as v, ResponsiveDialogTitle as y } from "@burdenoff/fe-libs/ui";
|
|
21
|
+
import { useGlobalUi as Ce } from "@burdenoff/fe-libs/shared/providers/shell/GlobalUiProvider";
|
|
20
22
|
//#region src/atheletebridge/pages/fixtures/FixtureDetailPage.tsx
|
|
21
|
-
function
|
|
22
|
-
let
|
|
23
|
+
function b() {
|
|
24
|
+
let b = e(), { id: x } = xe(), { navigateTo: S } = t(), C = ae(x), w = se(), T = ce(), E = oe(), D = ie(), { showToast: O } = Ce(), [k, A] = s(""), [j, M] = s(""), [N, we] = s(""), [P, Te] = s(""), [Ee, De] = s(""), [Oe, ke] = s(""), [Ae, je] = s({
|
|
23
25
|
homeRuns: "",
|
|
24
26
|
homeWickets: "",
|
|
25
27
|
homeOvers: "",
|
|
@@ -33,210 +35,363 @@ function k() {
|
|
|
33
35
|
margin: "",
|
|
34
36
|
superOver: !1,
|
|
35
37
|
dls: !1
|
|
36
|
-
}), [
|
|
37
|
-
if (
|
|
38
|
-
title:
|
|
39
|
-
children: /* @__PURE__ */
|
|
38
|
+
}), [F, I] = s(null), L = le(C.data?.scheduledAt), [R, z] = s(null), [B, V] = s(""), [H, U] = s(""), [Me, W] = s(!1);
|
|
39
|
+
if (C.isLoading) return /* @__PURE__ */ d(n, {
|
|
40
|
+
title: b("atheletebridge.pages.fixtureDetail.title", "Fixture"),
|
|
41
|
+
children: /* @__PURE__ */ d(re, { label: b("atheletebridge.pages.fixtureDetail.loading", "Loading fixture…") })
|
|
40
42
|
});
|
|
41
|
-
if (
|
|
42
|
-
title:
|
|
43
|
-
children: /* @__PURE__ */
|
|
44
|
-
title:
|
|
45
|
-
message:
|
|
46
|
-
onRetry: () =>
|
|
43
|
+
if (C.isError || !C.data) return /* @__PURE__ */ d(n, {
|
|
44
|
+
title: b("atheletebridge.pages.fixtureDetail.title", "Fixture"),
|
|
45
|
+
children: /* @__PURE__ */ d(ne, {
|
|
46
|
+
title: b("atheletebridge.pages.fixtureDetail.notFoundTitle", "Fixture not found"),
|
|
47
|
+
message: b("atheletebridge.pages.fixtureDetail.notFoundMessage", "This fixture does not exist or you do not have access to it."),
|
|
48
|
+
onRetry: () => S("/fixtures")
|
|
47
49
|
})
|
|
48
50
|
});
|
|
49
|
-
let
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
let G = C.data, K = G.homeTeam?.name ?? b("atheletebridge.pages.fixtureDetail.home", "Home"), q = G.awayTeam?.name ?? (G.awayTeamId ? b("atheletebridge.pages.fixtureDetail.away", "Away") : "TBD"), J = !!G.awayTeamId && (G.status === "SCHEDULED" || G.status === "LIVE"), Ne = J && L, Pe = J && !L;
|
|
52
|
+
o(k), o(j), o(N), o(P);
|
|
53
|
+
let { canReschedule: Y, canPostpone: X, canCancel: Z } = pe(G.status), Q = R === "reschedule" ? T.isPending : E.isPending, $ = (e) => {
|
|
54
|
+
let t = me(e, G);
|
|
55
|
+
V(t.scheduledAtInput), U(t.kickoffAtInput), z(e);
|
|
56
|
+
}, Fe = async (e) => {
|
|
57
|
+
e.preventDefault();
|
|
58
|
+
let t = fe(B, H);
|
|
59
|
+
if (!t) {
|
|
60
|
+
O(b("atheletebridge.pages.fixtureDetail.scheduleDateRequired", "Pick a date and time first."), "error");
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
try {
|
|
64
|
+
R === "reschedule" ? (await T.mutateAsync({
|
|
65
|
+
id: G.id,
|
|
66
|
+
input: t
|
|
67
|
+
}), O(b("atheletebridge.pages.fixtureDetail.rescheduledToast", "Fixture rescheduled."), "success")) : (await E.mutateAsync({
|
|
68
|
+
id: G.id,
|
|
69
|
+
input: t
|
|
70
|
+
}), O(b("atheletebridge.pages.fixtureDetail.postponedToast", "Fixture postponed."), "success")), z(null);
|
|
71
|
+
} catch (e) {
|
|
72
|
+
O(e instanceof Error ? e.message : b("common.error", "Something went wrong."), "error");
|
|
73
|
+
}
|
|
74
|
+
}, Ie = async () => {
|
|
75
|
+
try {
|
|
76
|
+
await D.mutateAsync(G.id), O(b("atheletebridge.pages.fixtureDetail.cancelledToast", "Fixture cancelled."), "success"), W(!1);
|
|
77
|
+
} catch (e) {
|
|
78
|
+
O(e instanceof Error ? e.message : b("common.error", "Something went wrong."), "error"), W(!1);
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
return /* @__PURE__ */ f(n, {
|
|
82
|
+
title: `${K} vs ${q}`,
|
|
83
|
+
description: `${ee[G.type]}${G.competition ? ` · ${G.competition}` : ""}`,
|
|
84
|
+
actions: /* @__PURE__ */ f("button", {
|
|
54
85
|
type: "button",
|
|
55
|
-
onClick: () =>
|
|
86
|
+
onClick: () => S("/fixtures"),
|
|
56
87
|
className: "inline-flex items-center gap-1.5 rounded-lg border border-border-seam px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken",
|
|
57
88
|
children: [
|
|
58
|
-
/* @__PURE__ */
|
|
89
|
+
/* @__PURE__ */ d(ge, { className: "h-4 w-4" }),
|
|
59
90
|
" ",
|
|
60
|
-
|
|
91
|
+
b("atheletebridge.pages.fixtureDetail.back", "Back")
|
|
61
92
|
]
|
|
62
93
|
}),
|
|
63
94
|
children: [
|
|
64
|
-
/* @__PURE__ */
|
|
65
|
-
fixture:
|
|
95
|
+
/* @__PURE__ */ d(te, {
|
|
96
|
+
fixture: G,
|
|
66
97
|
variant: "hero",
|
|
67
98
|
className: "mb-8"
|
|
68
99
|
}),
|
|
69
|
-
/* @__PURE__ */
|
|
100
|
+
/* @__PURE__ */ f("div", {
|
|
70
101
|
className: "mb-8 grid grid-cols-1 gap-4 lg:grid-cols-[minmax(0,1fr)_2fr]",
|
|
71
|
-
children: [/* @__PURE__ */
|
|
72
|
-
teamId:
|
|
73
|
-
fixtureId:
|
|
74
|
-
}), /* @__PURE__ */
|
|
75
|
-
teamId:
|
|
76
|
-
fixtureId:
|
|
102
|
+
children: [/* @__PURE__ */ d(ue, {
|
|
103
|
+
teamId: G.homeTeamId,
|
|
104
|
+
fixtureId: G.id
|
|
105
|
+
}), /* @__PURE__ */ d(de, {
|
|
106
|
+
teamId: G.homeTeamId,
|
|
107
|
+
fixtureId: G.id
|
|
77
108
|
})]
|
|
78
109
|
}),
|
|
79
|
-
|
|
110
|
+
G.notes && /* @__PURE__ */ f(p, {
|
|
80
111
|
className: "mb-8",
|
|
81
|
-
children: [/* @__PURE__ */
|
|
112
|
+
children: [/* @__PURE__ */ d("h2", {
|
|
82
113
|
className: "mb-2 text-sm font-semibold text-text-primary",
|
|
83
|
-
children:
|
|
84
|
-
}), /* @__PURE__ */
|
|
114
|
+
children: b("atheletebridge.pages.fixtureDetail.notes", "Notes")
|
|
115
|
+
}), /* @__PURE__ */ d("p", {
|
|
85
116
|
className: "text-sm text-text-secondary",
|
|
86
|
-
children:
|
|
117
|
+
children: G.notes
|
|
87
118
|
})]
|
|
88
119
|
}),
|
|
89
|
-
|
|
120
|
+
(Y || X || Z) && /* @__PURE__ */ f("section", {
|
|
90
121
|
className: "mb-8",
|
|
91
|
-
children: /* @__PURE__ */
|
|
122
|
+
children: [/* @__PURE__ */ f("h2", {
|
|
123
|
+
className: "mb-4 flex items-center gap-2 text-lg font-semibold text-text-primary",
|
|
124
|
+
children: [
|
|
125
|
+
/* @__PURE__ */ d(c, { className: "h-5 w-5" }),
|
|
126
|
+
" ",
|
|
127
|
+
b("atheletebridge.pages.fixtureDetail.fixtureActions", "Fixture actions")
|
|
128
|
+
]
|
|
129
|
+
}), /* @__PURE__ */ f(m, {
|
|
130
|
+
treatment: "plain",
|
|
131
|
+
className: "flex flex-wrap items-center gap-3 p-5 sm:p-6",
|
|
132
|
+
children: [
|
|
133
|
+
Y && /* @__PURE__ */ f("button", {
|
|
134
|
+
type: "button",
|
|
135
|
+
onClick: () => $("reschedule"),
|
|
136
|
+
className: "inline-flex items-center gap-1.5 rounded-lg border border-border-seam px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken",
|
|
137
|
+
children: [
|
|
138
|
+
/* @__PURE__ */ d(ve, { className: "h-4 w-4" }),
|
|
139
|
+
" ",
|
|
140
|
+
b("atheletebridge.pages.fixtureDetail.reschedule", "Reschedule")
|
|
141
|
+
]
|
|
142
|
+
}),
|
|
143
|
+
X && /* @__PURE__ */ f("button", {
|
|
144
|
+
type: "button",
|
|
145
|
+
onClick: () => $("postpone"),
|
|
146
|
+
className: "inline-flex items-center gap-1.5 rounded-lg border border-border-seam px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken",
|
|
147
|
+
children: [
|
|
148
|
+
/* @__PURE__ */ d(c, { className: "h-4 w-4" }),
|
|
149
|
+
" ",
|
|
150
|
+
b("atheletebridge.pages.fixtureDetail.postpone", "Postpone")
|
|
151
|
+
]
|
|
152
|
+
}),
|
|
153
|
+
Z && /* @__PURE__ */ f("button", {
|
|
154
|
+
type: "button",
|
|
155
|
+
onClick: () => W(!0),
|
|
156
|
+
className: "inline-flex items-center gap-1.5 rounded-lg border border-border-seam px-4 py-2 text-sm font-medium text-status-error-text transition-colors hover:bg-status-error-bg-subtle",
|
|
157
|
+
children: [
|
|
158
|
+
/* @__PURE__ */ d(_e, { className: "h-4 w-4" }),
|
|
159
|
+
" ",
|
|
160
|
+
b("atheletebridge.pages.fixtureDetail.cancelFixture", "Cancel fixture")
|
|
161
|
+
]
|
|
162
|
+
})
|
|
163
|
+
]
|
|
164
|
+
})]
|
|
165
|
+
}),
|
|
166
|
+
Pe && /* @__PURE__ */ d(p, {
|
|
167
|
+
className: "mb-8",
|
|
168
|
+
children: /* @__PURE__ */ d("p", {
|
|
92
169
|
className: "text-sm text-text-secondary",
|
|
93
|
-
children:
|
|
170
|
+
children: b("atheletebridge.pages.fixtureDetail.recordResultUnavailable", "A result can be recorded once this fixture has started — after its scheduled date and time.")
|
|
94
171
|
})
|
|
95
172
|
}),
|
|
96
|
-
|
|
173
|
+
Ne && /* @__PURE__ */ f("section", {
|
|
97
174
|
className: "mb-8",
|
|
98
|
-
children: [/* @__PURE__ */
|
|
175
|
+
children: [/* @__PURE__ */ f("h2", {
|
|
99
176
|
className: "mb-4 flex items-center gap-2 text-lg font-semibold text-text-primary",
|
|
100
177
|
children: [
|
|
101
|
-
/* @__PURE__ */
|
|
178
|
+
/* @__PURE__ */ d(ye, { className: "h-5 w-5" }),
|
|
102
179
|
" ",
|
|
103
|
-
|
|
180
|
+
b("atheletebridge.pages.fixtureDetail.recordResult", "Record result")
|
|
104
181
|
]
|
|
105
|
-
}), /* @__PURE__ */
|
|
182
|
+
}), /* @__PURE__ */ f(m, {
|
|
106
183
|
treatment: "insight",
|
|
107
184
|
className: "p-5 sm:p-6",
|
|
108
185
|
children: [
|
|
109
|
-
/* @__PURE__ */
|
|
186
|
+
/* @__PURE__ */ d("p", {
|
|
110
187
|
className: "mb-5 text-sm text-text-secondary",
|
|
111
|
-
children:
|
|
188
|
+
children: b("atheletebridge.pages.fixtureDetail.recordResultDescription", "Recording a final score marks this fixture Completed and recomputes the competition standings for both teams.")
|
|
112
189
|
}),
|
|
113
|
-
/* @__PURE__ */
|
|
190
|
+
/* @__PURE__ */ f("form", {
|
|
114
191
|
onSubmit: async (e) => {
|
|
115
|
-
if (e.preventDefault(),
|
|
116
|
-
let t =
|
|
117
|
-
homeScore:
|
|
118
|
-
awayScore:
|
|
119
|
-
extraTimeHome:
|
|
120
|
-
extraTimeAway:
|
|
121
|
-
penaltyHome:
|
|
122
|
-
penaltyAway:
|
|
192
|
+
if (e.preventDefault(), I(null), !x) return;
|
|
193
|
+
let t = he({
|
|
194
|
+
homeScore: k,
|
|
195
|
+
awayScore: j,
|
|
196
|
+
extraTimeHome: N,
|
|
197
|
+
extraTimeAway: P,
|
|
198
|
+
penaltyHome: Ee,
|
|
199
|
+
penaltyAway: Oe
|
|
123
200
|
}, {
|
|
124
|
-
scoresRequired:
|
|
125
|
-
scoresNegative:
|
|
126
|
-
extraTimePair:
|
|
127
|
-
extraTimeNumeric:
|
|
128
|
-
extraTimeNegative:
|
|
129
|
-
penaltyPair:
|
|
130
|
-
penaltyNumeric:
|
|
131
|
-
penaltyNegative:
|
|
132
|
-
extraTimeDecided:
|
|
133
|
-
extraTimeLevel:
|
|
134
|
-
penaltyLevel:
|
|
201
|
+
scoresRequired: b("atheletebridge.pages.fixtureDetail.scoresRequired", "Both scores are required and must be numbers."),
|
|
202
|
+
scoresNegative: b("atheletebridge.pages.fixtureDetail.scoresNegative", "Scores cannot be negative."),
|
|
203
|
+
extraTimePair: b("atheletebridge.pages.fixtureDetail.extraTimePair", "Enter both extra-time scores."),
|
|
204
|
+
extraTimeNumeric: b("atheletebridge.pages.fixtureDetail.extraTimeNumeric", "Extra-time scores must be numbers."),
|
|
205
|
+
extraTimeNegative: b("atheletebridge.pages.fixtureDetail.extraTimeNegative", "Extra-time scores cannot be negative."),
|
|
206
|
+
penaltyPair: b("atheletebridge.pages.fixtureDetail.penaltyPair", "Enter both penalty scores."),
|
|
207
|
+
penaltyNumeric: b("atheletebridge.pages.fixtureDetail.penaltyNumeric", "Penalty scores must be numbers."),
|
|
208
|
+
penaltyNegative: b("atheletebridge.pages.fixtureDetail.penaltyNegative", "Penalty scores cannot be negative."),
|
|
209
|
+
extraTimeDecided: b("atheletebridge.pages.fixtureDetail.extraTimeDecided", "Extra time decided the tie — leave the penalty shootout empty."),
|
|
210
|
+
extraTimeLevel: b("atheletebridge.pages.fixtureDetail.extraTimeLevel", "Still level after extra time — record the penalty shootout."),
|
|
211
|
+
penaltyLevel: b("atheletebridge.pages.fixtureDetail.penaltyLevel", "Penalty scores must have a winner.")
|
|
135
212
|
});
|
|
136
213
|
if (!t.ok) {
|
|
137
|
-
|
|
214
|
+
I(t.error);
|
|
138
215
|
return;
|
|
139
216
|
}
|
|
140
217
|
try {
|
|
141
|
-
await
|
|
142
|
-
id:
|
|
218
|
+
await w.mutateAsync({
|
|
219
|
+
id: x,
|
|
143
220
|
input: t.input
|
|
144
|
-
}),
|
|
221
|
+
}), A(""), M(""), we(""), Te(""), De(""), ke("");
|
|
145
222
|
} catch (e) {
|
|
146
|
-
|
|
223
|
+
I(e instanceof Error ? e.message : b("atheletebridge.pages.fixtureDetail.recordFailed", "Failed to record result."));
|
|
147
224
|
}
|
|
148
225
|
},
|
|
149
|
-
children: [/* @__PURE__ */
|
|
226
|
+
children: [/* @__PURE__ */ f(Se, { children: [/* @__PURE__ */ f("div", {
|
|
150
227
|
className: "flex flex-wrap items-end justify-center gap-4 sm:gap-6",
|
|
151
228
|
children: [
|
|
152
|
-
/* @__PURE__ */
|
|
229
|
+
/* @__PURE__ */ f("div", {
|
|
153
230
|
className: "flex items-end gap-3",
|
|
154
|
-
children: [/* @__PURE__ */
|
|
231
|
+
children: [/* @__PURE__ */ f("div", {
|
|
155
232
|
className: "flex flex-col items-center gap-2",
|
|
156
|
-
children: [/* @__PURE__ */
|
|
157
|
-
name:
|
|
158
|
-
sport:
|
|
233
|
+
children: [/* @__PURE__ */ d(r, {
|
|
234
|
+
name: K,
|
|
235
|
+
sport: G.homeTeam?.sport,
|
|
159
236
|
size: 40
|
|
160
|
-
}), /* @__PURE__ */
|
|
237
|
+
}), /* @__PURE__ */ d("span", {
|
|
161
238
|
className: "max-w-[8rem] truncate text-center text-xs font-medium text-text-secondary",
|
|
162
|
-
children:
|
|
239
|
+
children: K
|
|
163
240
|
})]
|
|
164
|
-
}), /* @__PURE__ */
|
|
165
|
-
label:
|
|
241
|
+
}), /* @__PURE__ */ d(i, {
|
|
242
|
+
label: b("atheletebridge.pages.fixtureDetail.home", "Home"),
|
|
166
243
|
htmlFor: "homeScore",
|
|
167
244
|
className: "w-24",
|
|
168
|
-
children: /* @__PURE__ */
|
|
245
|
+
children: /* @__PURE__ */ d("input", {
|
|
169
246
|
id: "homeScore",
|
|
170
247
|
inputMode: "numeric",
|
|
171
|
-
className: `${
|
|
172
|
-
value:
|
|
173
|
-
onChange: (e) =>
|
|
248
|
+
className: `${a} text-center text-lg font-bold tabular-nums`,
|
|
249
|
+
value: k,
|
|
250
|
+
onChange: (e) => A(e.target.value),
|
|
174
251
|
placeholder: "0"
|
|
175
252
|
})
|
|
176
253
|
})]
|
|
177
254
|
}),
|
|
178
|
-
/* @__PURE__ */
|
|
255
|
+
/* @__PURE__ */ d(be, {
|
|
179
256
|
className: "mb-3 h-5 w-5 shrink-0 text-text-muted",
|
|
180
257
|
"aria-hidden": "true"
|
|
181
258
|
}),
|
|
182
|
-
/* @__PURE__ */
|
|
259
|
+
/* @__PURE__ */ f("div", {
|
|
183
260
|
className: "flex items-end gap-3",
|
|
184
|
-
children: [/* @__PURE__ */
|
|
185
|
-
label:
|
|
261
|
+
children: [/* @__PURE__ */ d(i, {
|
|
262
|
+
label: b("atheletebridge.pages.fixtureDetail.away", "Away"),
|
|
186
263
|
htmlFor: "awayScore",
|
|
187
264
|
className: "w-24",
|
|
188
|
-
children: /* @__PURE__ */
|
|
265
|
+
children: /* @__PURE__ */ d("input", {
|
|
189
266
|
id: "awayScore",
|
|
190
267
|
inputMode: "numeric",
|
|
191
|
-
className: `${
|
|
192
|
-
value:
|
|
193
|
-
onChange: (e) =>
|
|
268
|
+
className: `${a} text-center text-lg font-bold tabular-nums`,
|
|
269
|
+
value: j,
|
|
270
|
+
onChange: (e) => M(e.target.value),
|
|
194
271
|
placeholder: "0"
|
|
195
272
|
})
|
|
196
|
-
}), /* @__PURE__ */
|
|
273
|
+
}), /* @__PURE__ */ f("div", {
|
|
197
274
|
className: "flex flex-col items-center gap-2",
|
|
198
|
-
children: [/* @__PURE__ */
|
|
199
|
-
name:
|
|
200
|
-
sport:
|
|
275
|
+
children: [/* @__PURE__ */ d(r, {
|
|
276
|
+
name: q,
|
|
277
|
+
sport: G.awayTeam?.sport,
|
|
201
278
|
size: 40
|
|
202
|
-
}), /* @__PURE__ */
|
|
279
|
+
}), /* @__PURE__ */ d("span", {
|
|
203
280
|
className: "max-w-[8rem] truncate text-center text-xs font-medium text-text-secondary",
|
|
204
|
-
children:
|
|
281
|
+
children: q
|
|
205
282
|
})]
|
|
206
283
|
})]
|
|
207
284
|
})
|
|
208
285
|
]
|
|
209
|
-
}), !1] }), /* @__PURE__ */
|
|
286
|
+
}), !1] }), /* @__PURE__ */ d("div", {
|
|
210
287
|
className: "mt-6 flex justify-center",
|
|
211
|
-
children: /* @__PURE__ */
|
|
288
|
+
children: /* @__PURE__ */ f("button", {
|
|
212
289
|
type: "submit",
|
|
213
|
-
disabled:
|
|
290
|
+
disabled: w.isPending,
|
|
214
291
|
className: "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-6 py-2.5 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90 disabled:opacity-60",
|
|
215
|
-
children: [
|
|
292
|
+
children: [w.isPending ? /* @__PURE__ */ d(l, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ d(u, { className: "h-4 w-4" }), b("atheletebridge.pages.fixtureDetail.recordResultAction", "Record result")]
|
|
216
293
|
})
|
|
217
294
|
})]
|
|
218
295
|
}),
|
|
219
|
-
|
|
296
|
+
F && /* @__PURE__ */ d("p", {
|
|
220
297
|
className: "mt-3 text-center text-sm text-status-error-text",
|
|
221
|
-
children:
|
|
298
|
+
children: F
|
|
222
299
|
})
|
|
223
300
|
]
|
|
224
301
|
})]
|
|
225
302
|
}),
|
|
226
|
-
|
|
303
|
+
G.competition && /* @__PURE__ */ f("button", {
|
|
227
304
|
type: "button",
|
|
228
|
-
onClick: () =>
|
|
305
|
+
onClick: () => S(`/standings?competition=${encodeURIComponent(G.competition ?? "")}`),
|
|
229
306
|
className: "inline-flex items-center gap-1.5 rounded-lg border border-border-seam px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken",
|
|
230
307
|
children: [
|
|
231
|
-
/* @__PURE__ */
|
|
308
|
+
/* @__PURE__ */ d(u, { className: "h-4 w-4" }),
|
|
232
309
|
" ",
|
|
233
|
-
|
|
310
|
+
b("atheletebridge.pages.fixtureDetail.viewStandings", `View ${G.competition} standings`)
|
|
234
311
|
]
|
|
312
|
+
}),
|
|
313
|
+
/* @__PURE__ */ d(h, {
|
|
314
|
+
open: R !== null,
|
|
315
|
+
onOpenChange: (e) => {
|
|
316
|
+
!e && !Q && z(null);
|
|
317
|
+
},
|
|
318
|
+
children: /* @__PURE__ */ f(g, { children: [/* @__PURE__ */ d(v, { children: /* @__PURE__ */ d(y, { children: R === "reschedule" ? b("atheletebridge.pages.fixtureDetail.rescheduleTitle", "Reschedule fixture") : b("atheletebridge.pages.fixtureDetail.postponeTitle", "Postpone fixture") }) }), /* @__PURE__ */ f("form", {
|
|
319
|
+
onSubmit: (e) => void Fe(e),
|
|
320
|
+
className: "space-y-4 px-1",
|
|
321
|
+
children: [
|
|
322
|
+
/* @__PURE__ */ d("p", {
|
|
323
|
+
className: "text-sm text-text-secondary",
|
|
324
|
+
children: R === "reschedule" ? b("atheletebridge.pages.fixtureDetail.rescheduleDescription", "Pick a new date and time for this fixture. Rescheduling a postponed fixture puts it back on the calendar as scheduled.") : b("atheletebridge.pages.fixtureDetail.postponeDescription", "Move this fixture to a later date. Its status becomes Postponed and it stays off the calendar until it is rescheduled.")
|
|
325
|
+
}),
|
|
326
|
+
/* @__PURE__ */ d(i, {
|
|
327
|
+
label: b("atheletebridge.pages.fixtureDetail.newDateTime", "New date & time"),
|
|
328
|
+
htmlFor: "fixtureScheduledAt",
|
|
329
|
+
required: !0,
|
|
330
|
+
children: /* @__PURE__ */ d("input", {
|
|
331
|
+
id: "fixtureScheduledAt",
|
|
332
|
+
type: "datetime-local",
|
|
333
|
+
className: a,
|
|
334
|
+
value: B,
|
|
335
|
+
onChange: (e) => V(e.target.value),
|
|
336
|
+
required: !0
|
|
337
|
+
})
|
|
338
|
+
}),
|
|
339
|
+
/* @__PURE__ */ d(i, {
|
|
340
|
+
label: b("atheletebridge.pages.fixtureDetail.newKickoff", "New kickoff (optional)"),
|
|
341
|
+
htmlFor: "fixtureKickoffAt",
|
|
342
|
+
children: /* @__PURE__ */ d("input", {
|
|
343
|
+
id: "fixtureKickoffAt",
|
|
344
|
+
type: "datetime-local",
|
|
345
|
+
className: a,
|
|
346
|
+
value: H,
|
|
347
|
+
onChange: (e) => U(e.target.value)
|
|
348
|
+
})
|
|
349
|
+
}),
|
|
350
|
+
/* @__PURE__ */ f(_, { children: [/* @__PURE__ */ d("button", {
|
|
351
|
+
type: "button",
|
|
352
|
+
onClick: () => z(null),
|
|
353
|
+
disabled: Q,
|
|
354
|
+
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",
|
|
355
|
+
children: b("common.cancel", "Cancel")
|
|
356
|
+
}), /* @__PURE__ */ f("button", {
|
|
357
|
+
type: "submit",
|
|
358
|
+
disabled: Q,
|
|
359
|
+
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",
|
|
360
|
+
children: [Q && /* @__PURE__ */ d(l, { className: "h-4 w-4 animate-spin" }), R === "reschedule" ? b("atheletebridge.pages.fixtureDetail.rescheduleAction", "Reschedule") : b("atheletebridge.pages.fixtureDetail.postponeAction", "Postpone")]
|
|
361
|
+
})] })
|
|
362
|
+
]
|
|
363
|
+
})] })
|
|
364
|
+
}),
|
|
365
|
+
/* @__PURE__ */ d(h, {
|
|
366
|
+
open: Me,
|
|
367
|
+
onOpenChange: (e) => {
|
|
368
|
+
!e && !D.isPending && W(!1);
|
|
369
|
+
},
|
|
370
|
+
children: /* @__PURE__ */ f(g, { children: [
|
|
371
|
+
/* @__PURE__ */ d(v, { children: /* @__PURE__ */ d(y, { children: b("atheletebridge.pages.fixtureDetail.cancelTitle", "Cancel fixture?") }) }),
|
|
372
|
+
/* @__PURE__ */ d("p", {
|
|
373
|
+
className: "px-1 text-sm text-text-secondary",
|
|
374
|
+
children: b("atheletebridge.pages.fixtureDetail.cancelMessage", "This fixture will be marked Cancelled. A cancelled fixture can never be played or rescheduled. This action cannot be undone.")
|
|
375
|
+
}),
|
|
376
|
+
/* @__PURE__ */ f(_, { children: [/* @__PURE__ */ d("button", {
|
|
377
|
+
type: "button",
|
|
378
|
+
onClick: () => W(!1),
|
|
379
|
+
disabled: D.isPending,
|
|
380
|
+
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",
|
|
381
|
+
children: b("common.keepFixture", "Keep fixture")
|
|
382
|
+
}), /* @__PURE__ */ f("button", {
|
|
383
|
+
type: "button",
|
|
384
|
+
onClick: () => void Ie(),
|
|
385
|
+
disabled: D.isPending,
|
|
386
|
+
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",
|
|
387
|
+
children: [D.isPending && /* @__PURE__ */ d(l, { className: "h-4 w-4 animate-spin" }), b("atheletebridge.pages.fixtureDetail.cancelConfirm", "Cancel fixture")]
|
|
388
|
+
})] })
|
|
389
|
+
] })
|
|
235
390
|
})
|
|
236
391
|
]
|
|
237
392
|
});
|
|
238
393
|
}
|
|
239
394
|
//#endregion
|
|
240
|
-
export {
|
|
395
|
+
export { b as FixtureDetailPage };
|
|
241
396
|
|
|
242
397
|
//# sourceMappingURL=FixtureDetailPage.js.map
|