@burdenoff/microfe-atheletebridge 2026.1009.1 → 2026.1023.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.
- package/dist/atheletebridge/components/MatchupRow.d.ts.map +1 -1
- package/dist/atheletebridge/components/MatchupRow.js +36 -36
- package/dist/atheletebridge/components/MatchupRow.js.map +1 -1
- package/dist/atheletebridge/components/Scoreboard.d.ts +71 -2
- package/dist/atheletebridge/components/Scoreboard.d.ts.map +1 -1
- package/dist/atheletebridge/components/Scoreboard.js +221 -96
- package/dist/atheletebridge/components/Scoreboard.js.map +1 -1
- package/dist/atheletebridge/hooks/useAthleteBridgeApi.d.ts.map +1 -1
- package/dist/atheletebridge/hooks/useAthleteBridgeApi.js +93 -82
- package/dist/atheletebridge/hooks/useAthleteBridgeApi.js.map +1 -1
- package/dist/atheletebridge/pages/fixtures/FixtureDetailPage.d.ts.map +1 -1
- package/dist/atheletebridge/pages/fixtures/FixtureDetailPage.js +427 -107
- package/dist/atheletebridge/pages/fixtures/FixtureDetailPage.js.map +1 -1
- package/dist/atheletebridge/pages/tournaments/TournamentBracketPage.d.ts.map +1 -1
- package/dist/atheletebridge/pages/tournaments/TournamentBracketPage.js +104 -103
- package/dist/atheletebridge/pages/tournaments/TournamentBracketPage.js.map +1 -1
- package/dist/atheletebridge/types/index.d.ts +74 -1
- package/dist/atheletebridge/types/index.d.ts.map +1 -1
- package/dist/atheletebridge/utils/index.d.ts +2 -0
- package/dist/atheletebridge/utils/index.d.ts.map +1 -1
- package/dist/atheletebridge/utils/recordResult.d.ts +92 -0
- package/dist/atheletebridge/utils/recordResult.d.ts.map +1 -0
- package/dist/atheletebridge/utils/recordResult.js +114 -0
- package/dist/atheletebridge/utils/recordResult.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,206 +1,526 @@
|
|
|
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 { FormField as
|
|
10
|
-
import { AvailabilityRsvpControl as
|
|
11
|
-
import { AvailabilityRosterPanel as
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
4
|
+
import { FIXTURE_TYPE_LABELS as ee } from "../../components/domain.js";
|
|
5
|
+
import { Crest as r } from "../../components/Crest.js";
|
|
6
|
+
import { Scoreboard as i } from "../../components/Scoreboard.js";
|
|
7
|
+
import { ErrorState as a, LoadingState as o } from "../../components/LoadingState.js";
|
|
8
|
+
import { useFixture as te, useRecordFixtureResult as s } from "../../hooks/useAthleteBridgeApi.js";
|
|
9
|
+
import { FormField as c, fieldInputClass as l } from "../../components/form.js";
|
|
10
|
+
import { AvailabilityRsvpControl as ne } from "../../components/availability/AvailabilityRsvpControl.js";
|
|
11
|
+
import { AvailabilityRosterPanel as re } from "../../components/availability/AvailabilityRosterPanel.js";
|
|
12
|
+
import { buildCricketResultInput as u, buildRecordResultInput as ie, parseScoreInput as d } from "../../utils/recordResult.js";
|
|
13
|
+
import { useState as f } from "react";
|
|
14
|
+
import { ArrowLeft as p, Flag as m, Loader2 as h, Minus as g, Trophy as _ } from "lucide-react";
|
|
15
|
+
import { useParams as ae } from "react-router";
|
|
16
|
+
import { Fragment as oe, jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
17
|
+
import { EmphasisPanel as se, GlassCard as b } from "@burdenoff/fe-libs/ui";
|
|
17
18
|
//#region src/atheletebridge/pages/fixtures/FixtureDetailPage.tsx
|
|
18
|
-
function
|
|
19
|
-
let
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
function x() {
|
|
20
|
+
let x = e(), { id: S } = ae(), { navigateTo: C } = t(), w = te(S), T = s(), [E, D] = f(""), [O, k] = f(""), [A, j] = f(""), [M, N] = f(""), [P, F] = f(""), [I, L] = f(""), [R, z] = f({
|
|
21
|
+
homeRuns: "",
|
|
22
|
+
homeWickets: "",
|
|
23
|
+
homeOvers: "",
|
|
24
|
+
homeBalls: "",
|
|
25
|
+
awayRuns: "",
|
|
26
|
+
awayWickets: "",
|
|
27
|
+
awayOvers: "",
|
|
28
|
+
awayBalls: "",
|
|
29
|
+
winner: "HOME",
|
|
30
|
+
decidedBy: "RUNS",
|
|
31
|
+
margin: "",
|
|
32
|
+
superOver: !1,
|
|
33
|
+
dls: !1
|
|
34
|
+
}), [B, V] = f(null), H = (e, t) => z((n) => ({
|
|
35
|
+
...n,
|
|
36
|
+
[e]: t
|
|
37
|
+
})), U = () => z({
|
|
38
|
+
homeRuns: "",
|
|
39
|
+
homeWickets: "",
|
|
40
|
+
homeOvers: "",
|
|
41
|
+
homeBalls: "",
|
|
42
|
+
awayRuns: "",
|
|
43
|
+
awayWickets: "",
|
|
44
|
+
awayOvers: "",
|
|
45
|
+
awayBalls: "",
|
|
46
|
+
winner: "HOME",
|
|
47
|
+
decidedBy: "RUNS",
|
|
48
|
+
margin: "",
|
|
49
|
+
superOver: !1,
|
|
50
|
+
dls: !1
|
|
23
51
|
});
|
|
24
|
-
if (
|
|
25
|
-
title:
|
|
26
|
-
children: /* @__PURE__ */
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
52
|
+
if (w.isLoading) return /* @__PURE__ */ v(n, {
|
|
53
|
+
title: x("atheletebridge.pages.fixtureDetail.title", "Fixture"),
|
|
54
|
+
children: /* @__PURE__ */ v(o, { label: x("atheletebridge.pages.fixtureDetail.loading", "Loading fixture…") })
|
|
55
|
+
});
|
|
56
|
+
if (w.isError || !w.data) return /* @__PURE__ */ v(n, {
|
|
57
|
+
title: x("atheletebridge.pages.fixtureDetail.title", "Fixture"),
|
|
58
|
+
children: /* @__PURE__ */ v(a, {
|
|
59
|
+
title: x("atheletebridge.pages.fixtureDetail.notFoundTitle", "Fixture not found"),
|
|
60
|
+
message: x("atheletebridge.pages.fixtureDetail.notFoundMessage", "This fixture does not exist or you do not have access to it."),
|
|
61
|
+
onRetry: () => C("/fixtures")
|
|
30
62
|
})
|
|
31
63
|
});
|
|
32
|
-
let
|
|
33
|
-
return /* @__PURE__ */
|
|
34
|
-
title: `${
|
|
35
|
-
description: `${
|
|
36
|
-
actions: /* @__PURE__ */
|
|
64
|
+
let W = w.data, G = W.homeTeam?.name ?? x("atheletebridge.pages.fixtureDetail.home", "Home"), K = W.awayTeam?.name ?? (W.awayTeamId ? x("atheletebridge.pages.fixtureDetail.away", "Away") : "TBD"), q = !!W.awayTeamId && (W.status === "SCHEDULED" || W.status === "LIVE"), J = W.homeTeam?.sport === "CRICKET", Y = d(E), X = d(O), Z = Y !== null && X !== null && Y === X, ce = A !== "" || M !== "", Q = d(A), $ = d(M), le = Z && (!ce || Q !== null && $ !== null && Q === $);
|
|
65
|
+
return /* @__PURE__ */ y(n, {
|
|
66
|
+
title: `${G} vs ${K}`,
|
|
67
|
+
description: `${ee[W.type]}${W.competition ? ` · ${W.competition}` : ""}`,
|
|
68
|
+
actions: /* @__PURE__ */ y("button", {
|
|
37
69
|
type: "button",
|
|
38
|
-
onClick: () =>
|
|
70
|
+
onClick: () => C("/fixtures"),
|
|
39
71
|
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",
|
|
40
72
|
children: [
|
|
41
|
-
/* @__PURE__ */
|
|
73
|
+
/* @__PURE__ */ v(p, { className: "h-4 w-4" }),
|
|
42
74
|
" ",
|
|
43
|
-
|
|
75
|
+
x("atheletebridge.pages.fixtureDetail.back", "Back")
|
|
44
76
|
]
|
|
45
77
|
}),
|
|
46
78
|
children: [
|
|
47
|
-
/* @__PURE__ */
|
|
48
|
-
fixture:
|
|
79
|
+
/* @__PURE__ */ v(i, {
|
|
80
|
+
fixture: W,
|
|
49
81
|
variant: "hero",
|
|
50
82
|
className: "mb-8"
|
|
51
83
|
}),
|
|
52
|
-
/* @__PURE__ */
|
|
84
|
+
/* @__PURE__ */ y("div", {
|
|
53
85
|
className: "mb-8 grid grid-cols-1 gap-4 lg:grid-cols-[minmax(0,1fr)_2fr]",
|
|
54
|
-
children: [/* @__PURE__ */
|
|
55
|
-
teamId:
|
|
56
|
-
fixtureId:
|
|
57
|
-
}), /* @__PURE__ */
|
|
58
|
-
teamId:
|
|
59
|
-
fixtureId:
|
|
86
|
+
children: [/* @__PURE__ */ v(ne, {
|
|
87
|
+
teamId: W.homeTeamId,
|
|
88
|
+
fixtureId: W.id
|
|
89
|
+
}), /* @__PURE__ */ v(re, {
|
|
90
|
+
teamId: W.homeTeamId,
|
|
91
|
+
fixtureId: W.id
|
|
60
92
|
})]
|
|
61
93
|
}),
|
|
62
|
-
|
|
94
|
+
W.notes && /* @__PURE__ */ y(se, {
|
|
63
95
|
className: "mb-8",
|
|
64
|
-
children: [/* @__PURE__ */
|
|
96
|
+
children: [/* @__PURE__ */ v("h2", {
|
|
65
97
|
className: "mb-2 text-sm font-semibold text-text-primary",
|
|
66
|
-
children:
|
|
67
|
-
}), /* @__PURE__ */
|
|
98
|
+
children: x("atheletebridge.pages.fixtureDetail.notes", "Notes")
|
|
99
|
+
}), /* @__PURE__ */ v("p", {
|
|
68
100
|
className: "text-sm text-text-secondary",
|
|
69
|
-
children:
|
|
101
|
+
children: W.notes
|
|
70
102
|
})]
|
|
71
103
|
}),
|
|
72
|
-
|
|
104
|
+
q && /* @__PURE__ */ y("section", {
|
|
73
105
|
className: "mb-8",
|
|
74
|
-
children: [/* @__PURE__ */
|
|
106
|
+
children: [/* @__PURE__ */ y("h2", {
|
|
75
107
|
className: "mb-4 flex items-center gap-2 text-lg font-semibold text-text-primary",
|
|
76
108
|
children: [
|
|
77
|
-
/* @__PURE__ */
|
|
109
|
+
/* @__PURE__ */ v(m, { className: "h-5 w-5" }),
|
|
78
110
|
" ",
|
|
79
|
-
|
|
111
|
+
x("atheletebridge.pages.fixtureDetail.recordResult", "Record result")
|
|
80
112
|
]
|
|
81
|
-
}), /* @__PURE__ */
|
|
113
|
+
}), /* @__PURE__ */ y(b, {
|
|
82
114
|
treatment: "insight",
|
|
83
115
|
className: "p-5 sm:p-6",
|
|
84
116
|
children: [
|
|
85
|
-
/* @__PURE__ */
|
|
117
|
+
/* @__PURE__ */ v("p", {
|
|
86
118
|
className: "mb-5 text-sm text-text-secondary",
|
|
87
|
-
children:
|
|
119
|
+
children: x("atheletebridge.pages.fixtureDetail.recordResultDescription", "Recording a final score marks this fixture Completed and recomputes the competition standings for both teams.")
|
|
88
120
|
}),
|
|
89
|
-
/* @__PURE__ */
|
|
121
|
+
/* @__PURE__ */ y("form", {
|
|
90
122
|
onSubmit: async (e) => {
|
|
91
|
-
if (e.preventDefault(),
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
123
|
+
if (e.preventDefault(), V(null), !S) return;
|
|
124
|
+
if (J) {
|
|
125
|
+
let e = u({ ...R }, {
|
|
126
|
+
required: x("atheletebridge.pages.fixtureDetail.cricketRequired", "All innings scores, overs and the margin are required."),
|
|
127
|
+
negative: x("atheletebridge.pages.fixtureDetail.cricketNegative", "Scores and overs cannot be negative."),
|
|
128
|
+
wicketsRange: x("atheletebridge.pages.fixtureDetail.cricketWicketsRange", "Wickets must be between 0 and 10."),
|
|
129
|
+
ballsRange: x("atheletebridge.pages.fixtureDetail.cricketBallsRange", "Balls must be between 0 and 5."),
|
|
130
|
+
marginMinimum: x("atheletebridge.pages.fixtureDetail.cricketMarginMinimum", "The margin must be at least 1."),
|
|
131
|
+
wicketMarginMax: x("atheletebridge.pages.fixtureDetail.cricketWicketMarginMax", "A win by wickets cannot exceed a margin of 10.")
|
|
132
|
+
});
|
|
133
|
+
if (!e.ok) {
|
|
134
|
+
V(e.error);
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
try {
|
|
138
|
+
await T.mutateAsync({
|
|
139
|
+
id: S,
|
|
140
|
+
input: e.input
|
|
141
|
+
}), U();
|
|
142
|
+
} catch (e) {
|
|
143
|
+
V(e instanceof Error ? e.message : x("atheletebridge.pages.fixtureDetail.recordFailed", "Failed to record result."));
|
|
144
|
+
}
|
|
95
145
|
return;
|
|
96
146
|
}
|
|
97
|
-
|
|
98
|
-
|
|
147
|
+
let t = ie({
|
|
148
|
+
homeScore: E,
|
|
149
|
+
awayScore: O,
|
|
150
|
+
extraTimeHome: A,
|
|
151
|
+
extraTimeAway: M,
|
|
152
|
+
penaltyHome: P,
|
|
153
|
+
penaltyAway: I
|
|
154
|
+
}, {
|
|
155
|
+
scoresRequired: x("atheletebridge.pages.fixtureDetail.scoresRequired", "Both scores are required and must be numbers."),
|
|
156
|
+
scoresNegative: x("atheletebridge.pages.fixtureDetail.scoresNegative", "Scores cannot be negative."),
|
|
157
|
+
extraTimePair: x("atheletebridge.pages.fixtureDetail.extraTimePair", "Enter both extra-time scores."),
|
|
158
|
+
extraTimeNumeric: x("atheletebridge.pages.fixtureDetail.extraTimeNumeric", "Extra-time scores must be numbers."),
|
|
159
|
+
extraTimeNegative: x("atheletebridge.pages.fixtureDetail.extraTimeNegative", "Extra-time scores cannot be negative."),
|
|
160
|
+
penaltyPair: x("atheletebridge.pages.fixtureDetail.penaltyPair", "Enter both penalty scores."),
|
|
161
|
+
penaltyNumeric: x("atheletebridge.pages.fixtureDetail.penaltyNumeric", "Penalty scores must be numbers."),
|
|
162
|
+
penaltyNegative: x("atheletebridge.pages.fixtureDetail.penaltyNegative", "Penalty scores cannot be negative."),
|
|
163
|
+
extraTimeDecided: x("atheletebridge.pages.fixtureDetail.extraTimeDecided", "Extra time decided the tie — leave the penalty shootout empty."),
|
|
164
|
+
extraTimeLevel: x("atheletebridge.pages.fixtureDetail.extraTimeLevel", "Still level after extra time — record the penalty shootout."),
|
|
165
|
+
penaltyLevel: x("atheletebridge.pages.fixtureDetail.penaltyLevel", "Penalty scores must have a winner.")
|
|
166
|
+
});
|
|
167
|
+
if (!t.ok) {
|
|
168
|
+
V(t.error);
|
|
99
169
|
return;
|
|
100
170
|
}
|
|
101
171
|
try {
|
|
102
|
-
await
|
|
103
|
-
id:
|
|
104
|
-
input:
|
|
105
|
-
|
|
106
|
-
awayScore: n
|
|
107
|
-
}
|
|
108
|
-
}), j(""), N("");
|
|
172
|
+
await T.mutateAsync({
|
|
173
|
+
id: S,
|
|
174
|
+
input: t.input
|
|
175
|
+
}), D(""), k(""), j(""), N(""), F(""), L("");
|
|
109
176
|
} catch (e) {
|
|
110
|
-
|
|
177
|
+
V(e instanceof Error ? e.message : x("atheletebridge.pages.fixtureDetail.recordFailed", "Failed to record result."));
|
|
111
178
|
}
|
|
112
179
|
},
|
|
113
|
-
children: [/* @__PURE__ */
|
|
180
|
+
children: [J ? /* @__PURE__ */ y("div", {
|
|
181
|
+
className: "flex flex-col items-center gap-5",
|
|
182
|
+
children: [
|
|
183
|
+
/* @__PURE__ */ v("p", {
|
|
184
|
+
className: "text-center text-xs font-medium text-text-secondary",
|
|
185
|
+
children: x("atheletebridge.pages.fixtureDetail.cricketScorecardDescription", "Record each innings score and how the match was decided — a cricket result is a margin, not a score comparison.")
|
|
186
|
+
}),
|
|
187
|
+
[{
|
|
188
|
+
side: "home",
|
|
189
|
+
name: G,
|
|
190
|
+
sport: W.homeTeam?.sport
|
|
191
|
+
}, {
|
|
192
|
+
side: "away",
|
|
193
|
+
name: K,
|
|
194
|
+
sport: W.awayTeam?.sport
|
|
195
|
+
}].map(({ side: e, name: t, sport: n }) => /* @__PURE__ */ y("div", {
|
|
196
|
+
className: "flex flex-wrap items-end justify-center gap-3",
|
|
197
|
+
children: [
|
|
198
|
+
/* @__PURE__ */ y("div", {
|
|
199
|
+
className: "flex flex-col items-center gap-2",
|
|
200
|
+
children: [/* @__PURE__ */ v(r, {
|
|
201
|
+
name: t,
|
|
202
|
+
sport: n,
|
|
203
|
+
size: 40
|
|
204
|
+
}), /* @__PURE__ */ v("span", {
|
|
205
|
+
className: "max-w-[8rem] truncate text-center text-xs font-medium text-text-secondary",
|
|
206
|
+
children: t
|
|
207
|
+
})]
|
|
208
|
+
}),
|
|
209
|
+
/* @__PURE__ */ v(c, {
|
|
210
|
+
label: x("atheletebridge.pages.fixtureDetail.runs", "Runs"),
|
|
211
|
+
htmlFor: `cricket-${e}-runs`,
|
|
212
|
+
className: "w-20",
|
|
213
|
+
children: /* @__PURE__ */ v("input", {
|
|
214
|
+
id: `cricket-${e}-runs`,
|
|
215
|
+
inputMode: "numeric",
|
|
216
|
+
className: `${l} text-center tabular-nums`,
|
|
217
|
+
value: R[`${e}Runs`],
|
|
218
|
+
onChange: (t) => H(`${e}Runs`, t.target.value),
|
|
219
|
+
placeholder: "185"
|
|
220
|
+
})
|
|
221
|
+
}),
|
|
222
|
+
/* @__PURE__ */ v("span", {
|
|
223
|
+
className: "pb-3 text-lg font-bold text-text-muted",
|
|
224
|
+
children: "/"
|
|
225
|
+
}),
|
|
226
|
+
/* @__PURE__ */ v(c, {
|
|
227
|
+
label: x("atheletebridge.pages.fixtureDetail.wickets", "Wkts"),
|
|
228
|
+
htmlFor: `cricket-${e}-wickets`,
|
|
229
|
+
className: "w-16",
|
|
230
|
+
children: /* @__PURE__ */ v("input", {
|
|
231
|
+
id: `cricket-${e}-wickets`,
|
|
232
|
+
inputMode: "numeric",
|
|
233
|
+
className: `${l} text-center tabular-nums`,
|
|
234
|
+
value: R[`${e}Wickets`],
|
|
235
|
+
onChange: (t) => H(`${e}Wickets`, t.target.value),
|
|
236
|
+
placeholder: "6"
|
|
237
|
+
})
|
|
238
|
+
}),
|
|
239
|
+
/* @__PURE__ */ v(c, {
|
|
240
|
+
label: x("atheletebridge.pages.fixtureDetail.overs", "Overs"),
|
|
241
|
+
htmlFor: `cricket-${e}-overs`,
|
|
242
|
+
className: "w-16",
|
|
243
|
+
children: /* @__PURE__ */ v("input", {
|
|
244
|
+
id: `cricket-${e}-overs`,
|
|
245
|
+
inputMode: "numeric",
|
|
246
|
+
className: `${l} text-center tabular-nums`,
|
|
247
|
+
value: R[`${e}Overs`],
|
|
248
|
+
onChange: (t) => H(`${e}Overs`, t.target.value),
|
|
249
|
+
placeholder: "20"
|
|
250
|
+
})
|
|
251
|
+
}),
|
|
252
|
+
/* @__PURE__ */ v(c, {
|
|
253
|
+
label: x("atheletebridge.pages.fixtureDetail.balls", "Balls"),
|
|
254
|
+
htmlFor: `cricket-${e}-balls`,
|
|
255
|
+
className: "w-14",
|
|
256
|
+
children: /* @__PURE__ */ v("input", {
|
|
257
|
+
id: `cricket-${e}-balls`,
|
|
258
|
+
inputMode: "numeric",
|
|
259
|
+
className: `${l} text-center tabular-nums`,
|
|
260
|
+
value: R[`${e}Balls`],
|
|
261
|
+
onChange: (t) => H(`${e}Balls`, t.target.value),
|
|
262
|
+
placeholder: "0"
|
|
263
|
+
})
|
|
264
|
+
})
|
|
265
|
+
]
|
|
266
|
+
}, e)),
|
|
267
|
+
/* @__PURE__ */ y("div", {
|
|
268
|
+
className: "flex flex-wrap items-end justify-center gap-4",
|
|
269
|
+
children: [
|
|
270
|
+
/* @__PURE__ */ v(c, {
|
|
271
|
+
label: x("atheletebridge.pages.fixtureDetail.winner", "Winner"),
|
|
272
|
+
htmlFor: "cricket-winner",
|
|
273
|
+
children: /* @__PURE__ */ y("select", {
|
|
274
|
+
id: "cricket-winner",
|
|
275
|
+
className: l,
|
|
276
|
+
value: R.winner,
|
|
277
|
+
onChange: (e) => H("winner", e.target.value),
|
|
278
|
+
children: [/* @__PURE__ */ v("option", {
|
|
279
|
+
value: "HOME",
|
|
280
|
+
children: G
|
|
281
|
+
}), /* @__PURE__ */ v("option", {
|
|
282
|
+
value: "AWAY",
|
|
283
|
+
children: K
|
|
284
|
+
})]
|
|
285
|
+
})
|
|
286
|
+
}),
|
|
287
|
+
/* @__PURE__ */ v(c, {
|
|
288
|
+
label: x("atheletebridge.pages.fixtureDetail.decidedBy", "Decided by"),
|
|
289
|
+
htmlFor: "cricket-decided-by",
|
|
290
|
+
children: /* @__PURE__ */ y("select", {
|
|
291
|
+
id: "cricket-decided-by",
|
|
292
|
+
className: l,
|
|
293
|
+
value: R.decidedBy,
|
|
294
|
+
onChange: (e) => H("decidedBy", e.target.value),
|
|
295
|
+
children: [/* @__PURE__ */ v("option", {
|
|
296
|
+
value: "RUNS",
|
|
297
|
+
children: x("atheletebridge.pages.fixtureDetail.runs", "Runs")
|
|
298
|
+
}), /* @__PURE__ */ v("option", {
|
|
299
|
+
value: "WICKETS",
|
|
300
|
+
children: x("atheletebridge.pages.fixtureDetail.wickets", "Wkts")
|
|
301
|
+
})]
|
|
302
|
+
})
|
|
303
|
+
}),
|
|
304
|
+
/* @__PURE__ */ v(c, {
|
|
305
|
+
label: x("atheletebridge.pages.fixtureDetail.margin", "Margin"),
|
|
306
|
+
htmlFor: "cricket-margin",
|
|
307
|
+
className: "w-20",
|
|
308
|
+
children: /* @__PURE__ */ v("input", {
|
|
309
|
+
id: "cricket-margin",
|
|
310
|
+
inputMode: "numeric",
|
|
311
|
+
className: `${l} text-center tabular-nums`,
|
|
312
|
+
value: R.margin,
|
|
313
|
+
onChange: (e) => H("margin", e.target.value),
|
|
314
|
+
placeholder: "13"
|
|
315
|
+
})
|
|
316
|
+
})
|
|
317
|
+
]
|
|
318
|
+
}),
|
|
319
|
+
/* @__PURE__ */ y("div", {
|
|
320
|
+
className: "flex items-center gap-6",
|
|
321
|
+
children: [/* @__PURE__ */ y("label", {
|
|
322
|
+
className: "flex items-center gap-2.5 text-sm text-text-primary",
|
|
323
|
+
children: [/* @__PURE__ */ v("input", {
|
|
324
|
+
type: "checkbox",
|
|
325
|
+
checked: R.superOver,
|
|
326
|
+
onChange: (e) => H("superOver", e.target.checked),
|
|
327
|
+
className: "h-4 w-4 rounded border-border-seam text-action-primary-bg focus:ring-[var(--color-focus-ring)]"
|
|
328
|
+
}), x("atheletebridge.pages.fixtureDetail.superOver", "Super Over")]
|
|
329
|
+
}), /* @__PURE__ */ y("label", {
|
|
330
|
+
className: "flex items-center gap-2.5 text-sm text-text-primary",
|
|
331
|
+
children: [/* @__PURE__ */ v("input", {
|
|
332
|
+
type: "checkbox",
|
|
333
|
+
checked: R.dls,
|
|
334
|
+
onChange: (e) => H("dls", e.target.checked),
|
|
335
|
+
className: "h-4 w-4 rounded border-border-seam text-action-primary-bg focus:ring-[var(--color-focus-ring)]"
|
|
336
|
+
}), x("atheletebridge.pages.fixtureDetail.dls", "DLS")]
|
|
337
|
+
})]
|
|
338
|
+
})
|
|
339
|
+
]
|
|
340
|
+
}) : /* @__PURE__ */ y(oe, { children: [/* @__PURE__ */ y("div", {
|
|
114
341
|
className: "flex flex-wrap items-end justify-center gap-4 sm:gap-6",
|
|
115
342
|
children: [
|
|
116
|
-
/* @__PURE__ */
|
|
343
|
+
/* @__PURE__ */ y("div", {
|
|
117
344
|
className: "flex items-end gap-3",
|
|
118
|
-
children: [/* @__PURE__ */
|
|
345
|
+
children: [/* @__PURE__ */ y("div", {
|
|
119
346
|
className: "flex flex-col items-center gap-2",
|
|
120
|
-
children: [/* @__PURE__ */
|
|
121
|
-
name:
|
|
122
|
-
sport:
|
|
347
|
+
children: [/* @__PURE__ */ v(r, {
|
|
348
|
+
name: G,
|
|
349
|
+
sport: W.homeTeam?.sport,
|
|
123
350
|
size: 40
|
|
124
|
-
}), /* @__PURE__ */
|
|
351
|
+
}), /* @__PURE__ */ v("span", {
|
|
125
352
|
className: "max-w-[8rem] truncate text-center text-xs font-medium text-text-secondary",
|
|
126
|
-
children:
|
|
353
|
+
children: G
|
|
127
354
|
})]
|
|
128
|
-
}), /* @__PURE__ */
|
|
129
|
-
label:
|
|
355
|
+
}), /* @__PURE__ */ v(c, {
|
|
356
|
+
label: x("atheletebridge.pages.fixtureDetail.home", "Home"),
|
|
130
357
|
htmlFor: "homeScore",
|
|
131
358
|
className: "w-24",
|
|
132
|
-
children: /* @__PURE__ */
|
|
359
|
+
children: /* @__PURE__ */ v("input", {
|
|
133
360
|
id: "homeScore",
|
|
134
361
|
inputMode: "numeric",
|
|
135
|
-
className: `${
|
|
136
|
-
value:
|
|
137
|
-
onChange: (e) =>
|
|
362
|
+
className: `${l} text-center text-lg font-bold tabular-nums`,
|
|
363
|
+
value: E,
|
|
364
|
+
onChange: (e) => D(e.target.value),
|
|
138
365
|
placeholder: "0"
|
|
139
366
|
})
|
|
140
367
|
})]
|
|
141
368
|
}),
|
|
142
|
-
/* @__PURE__ */
|
|
369
|
+
/* @__PURE__ */ v(g, {
|
|
143
370
|
className: "mb-3 h-5 w-5 shrink-0 text-text-muted",
|
|
144
371
|
"aria-hidden": "true"
|
|
145
372
|
}),
|
|
146
|
-
/* @__PURE__ */
|
|
373
|
+
/* @__PURE__ */ y("div", {
|
|
147
374
|
className: "flex items-end gap-3",
|
|
148
|
-
children: [/* @__PURE__ */
|
|
149
|
-
label:
|
|
375
|
+
children: [/* @__PURE__ */ v(c, {
|
|
376
|
+
label: x("atheletebridge.pages.fixtureDetail.away", "Away"),
|
|
150
377
|
htmlFor: "awayScore",
|
|
151
378
|
className: "w-24",
|
|
152
|
-
children: /* @__PURE__ */
|
|
379
|
+
children: /* @__PURE__ */ v("input", {
|
|
153
380
|
id: "awayScore",
|
|
154
381
|
inputMode: "numeric",
|
|
155
|
-
className: `${
|
|
156
|
-
value:
|
|
157
|
-
onChange: (e) =>
|
|
382
|
+
className: `${l} text-center text-lg font-bold tabular-nums`,
|
|
383
|
+
value: O,
|
|
384
|
+
onChange: (e) => k(e.target.value),
|
|
158
385
|
placeholder: "0"
|
|
159
386
|
})
|
|
160
|
-
}), /* @__PURE__ */
|
|
387
|
+
}), /* @__PURE__ */ y("div", {
|
|
161
388
|
className: "flex flex-col items-center gap-2",
|
|
162
|
-
children: [/* @__PURE__ */
|
|
163
|
-
name:
|
|
164
|
-
sport:
|
|
389
|
+
children: [/* @__PURE__ */ v(r, {
|
|
390
|
+
name: K,
|
|
391
|
+
sport: W.awayTeam?.sport,
|
|
165
392
|
size: 40
|
|
166
|
-
}), /* @__PURE__ */
|
|
393
|
+
}), /* @__PURE__ */ v("span", {
|
|
167
394
|
className: "max-w-[8rem] truncate text-center text-xs font-medium text-text-secondary",
|
|
168
|
-
children:
|
|
395
|
+
children: K
|
|
169
396
|
})]
|
|
170
397
|
})]
|
|
171
398
|
})
|
|
172
399
|
]
|
|
173
|
-
}), /* @__PURE__ */
|
|
400
|
+
}), Z && /* @__PURE__ */ y("div", {
|
|
401
|
+
className: "mt-6 border-t border-border-seam pt-5",
|
|
402
|
+
children: [/* @__PURE__ */ v("p", {
|
|
403
|
+
className: "mb-4 text-center text-xs font-medium text-text-secondary",
|
|
404
|
+
children: x("atheletebridge.pages.fixtureDetail.levelAtFullTime", "Level at full time — record how the tie was decided (optional).")
|
|
405
|
+
}), /* @__PURE__ */ y("div", {
|
|
406
|
+
className: "flex flex-col items-center gap-4",
|
|
407
|
+
children: [/* @__PURE__ */ y("div", {
|
|
408
|
+
className: "flex items-end justify-center gap-3",
|
|
409
|
+
children: [
|
|
410
|
+
/* @__PURE__ */ v("span", {
|
|
411
|
+
className: "mb-2.5 w-16 text-right text-xs font-medium text-text-secondary",
|
|
412
|
+
children: G
|
|
413
|
+
}),
|
|
414
|
+
/* @__PURE__ */ v(c, {
|
|
415
|
+
label: x("atheletebridge.pages.fixtureDetail.extraTime", "Extra time"),
|
|
416
|
+
htmlFor: "extraTimeHome",
|
|
417
|
+
className: "w-20",
|
|
418
|
+
children: /* @__PURE__ */ v("input", {
|
|
419
|
+
id: "extraTimeHome",
|
|
420
|
+
inputMode: "numeric",
|
|
421
|
+
className: `${l} text-center tabular-nums`,
|
|
422
|
+
value: A,
|
|
423
|
+
onChange: (e) => j(e.target.value),
|
|
424
|
+
placeholder: "–"
|
|
425
|
+
})
|
|
426
|
+
}),
|
|
427
|
+
/* @__PURE__ */ v(g, {
|
|
428
|
+
className: "mb-3 h-4 w-4 shrink-0 text-text-muted",
|
|
429
|
+
"aria-hidden": "true"
|
|
430
|
+
}),
|
|
431
|
+
/* @__PURE__ */ v(c, {
|
|
432
|
+
label: "\xA0",
|
|
433
|
+
htmlFor: "extraTimeAway",
|
|
434
|
+
className: "w-20",
|
|
435
|
+
children: /* @__PURE__ */ v("input", {
|
|
436
|
+
id: "extraTimeAway",
|
|
437
|
+
inputMode: "numeric",
|
|
438
|
+
className: `${l} text-center tabular-nums`,
|
|
439
|
+
value: M,
|
|
440
|
+
onChange: (e) => N(e.target.value),
|
|
441
|
+
placeholder: "–"
|
|
442
|
+
})
|
|
443
|
+
}),
|
|
444
|
+
/* @__PURE__ */ v("span", {
|
|
445
|
+
className: "mb-2.5 w-16 truncate text-xs font-medium text-text-secondary",
|
|
446
|
+
children: K
|
|
447
|
+
})
|
|
448
|
+
]
|
|
449
|
+
}), le && /* @__PURE__ */ y("div", {
|
|
450
|
+
className: "flex items-end justify-center gap-3",
|
|
451
|
+
children: [
|
|
452
|
+
/* @__PURE__ */ v("span", {
|
|
453
|
+
className: "mb-2.5 w-16 text-right text-xs font-medium text-text-secondary",
|
|
454
|
+
children: G
|
|
455
|
+
}),
|
|
456
|
+
/* @__PURE__ */ v(c, {
|
|
457
|
+
label: x("atheletebridge.pages.fixtureDetail.penaltyShootout", "Penalties"),
|
|
458
|
+
htmlFor: "penaltyHome",
|
|
459
|
+
className: "w-20",
|
|
460
|
+
children: /* @__PURE__ */ v("input", {
|
|
461
|
+
id: "penaltyHome",
|
|
462
|
+
inputMode: "numeric",
|
|
463
|
+
className: `${l} text-center tabular-nums`,
|
|
464
|
+
value: P,
|
|
465
|
+
onChange: (e) => F(e.target.value),
|
|
466
|
+
placeholder: "–"
|
|
467
|
+
})
|
|
468
|
+
}),
|
|
469
|
+
/* @__PURE__ */ v(g, {
|
|
470
|
+
className: "mb-3 h-4 w-4 shrink-0 text-text-muted",
|
|
471
|
+
"aria-hidden": "true"
|
|
472
|
+
}),
|
|
473
|
+
/* @__PURE__ */ v(c, {
|
|
474
|
+
label: "\xA0",
|
|
475
|
+
htmlFor: "penaltyAway",
|
|
476
|
+
className: "w-20",
|
|
477
|
+
children: /* @__PURE__ */ v("input", {
|
|
478
|
+
id: "penaltyAway",
|
|
479
|
+
inputMode: "numeric",
|
|
480
|
+
className: `${l} text-center tabular-nums`,
|
|
481
|
+
value: I,
|
|
482
|
+
onChange: (e) => L(e.target.value),
|
|
483
|
+
placeholder: "–"
|
|
484
|
+
})
|
|
485
|
+
}),
|
|
486
|
+
/* @__PURE__ */ v("span", {
|
|
487
|
+
className: "mb-2.5 w-16 truncate text-xs font-medium text-text-secondary",
|
|
488
|
+
children: K
|
|
489
|
+
})
|
|
490
|
+
]
|
|
491
|
+
})]
|
|
492
|
+
})]
|
|
493
|
+
})] }), /* @__PURE__ */ v("div", {
|
|
174
494
|
className: "mt-6 flex justify-center",
|
|
175
|
-
children: /* @__PURE__ */
|
|
495
|
+
children: /* @__PURE__ */ y("button", {
|
|
176
496
|
type: "submit",
|
|
177
|
-
disabled:
|
|
497
|
+
disabled: T.isPending,
|
|
178
498
|
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",
|
|
179
|
-
children: [
|
|
499
|
+
children: [T.isPending ? /* @__PURE__ */ v(h, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ v(_, { className: "h-4 w-4" }), x("atheletebridge.pages.fixtureDetail.recordResultAction", "Record result")]
|
|
180
500
|
})
|
|
181
501
|
})]
|
|
182
502
|
}),
|
|
183
|
-
|
|
503
|
+
B && /* @__PURE__ */ v("p", {
|
|
184
504
|
className: "mt-3 text-center text-sm text-status-error-text",
|
|
185
|
-
children:
|
|
505
|
+
children: B
|
|
186
506
|
})
|
|
187
507
|
]
|
|
188
508
|
})]
|
|
189
509
|
}),
|
|
190
|
-
|
|
510
|
+
W.competition && /* @__PURE__ */ y("button", {
|
|
191
511
|
type: "button",
|
|
192
|
-
onClick: () =>
|
|
512
|
+
onClick: () => C(`/standings?competition=${encodeURIComponent(W.competition ?? "")}`),
|
|
193
513
|
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",
|
|
194
514
|
children: [
|
|
195
|
-
/* @__PURE__ */
|
|
515
|
+
/* @__PURE__ */ v(_, { className: "h-4 w-4" }),
|
|
196
516
|
" ",
|
|
197
|
-
|
|
517
|
+
x("atheletebridge.pages.fixtureDetail.viewStandings", `View ${W.competition} standings`)
|
|
198
518
|
]
|
|
199
519
|
})
|
|
200
520
|
]
|
|
201
521
|
});
|
|
202
522
|
}
|
|
203
523
|
//#endregion
|
|
204
|
-
export {
|
|
524
|
+
export { x as FixtureDetailPage };
|
|
205
525
|
|
|
206
526
|
//# sourceMappingURL=FixtureDetailPage.js.map
|