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