@burdenoff/microfe-atheletebridge 2026.1023.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/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/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 +203 -194
- 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/package.json +1 -1
|
@@ -5,53 +5,55 @@ import { RatingStars as r } from "../../components/viz/RatingStars.js";
|
|
|
5
5
|
import "../../components/viz/index.js";
|
|
6
6
|
import { StatusBadge as i } from "../../components/StatusBadge.js";
|
|
7
7
|
import { SESSION_TYPE_LABELS as a } from "../../components/domain.js";
|
|
8
|
-
import { formatDate as o, formatDuration as
|
|
9
|
-
import { UserAvatar as
|
|
10
|
-
import { ErrorState as
|
|
11
|
-
import { useCancelSession as
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
8
|
+
import { formatDate as o, formatDuration as s } from "../../utils/formatters.js";
|
|
9
|
+
import { UserAvatar as c } from "../../components/UserAvatar.js";
|
|
10
|
+
import { ErrorState as ee, LoadingState as te } from "../../components/LoadingState.js";
|
|
11
|
+
import { useCancelSession as ne, useCompleteSession as l, useConfirmSession as u, useSession as d, useUserDirectory as f } from "../../hooks/useAthleteBridgeApi.js";
|
|
12
|
+
import { useScheduledTimeGate as p } from "../../hooks/useScheduledTimeGate.js";
|
|
13
|
+
import "../../hooks/index.js";
|
|
14
|
+
import { FormField as m, fieldInputClass as h } from "../../components/form.js";
|
|
15
|
+
import { SessionStatusTimeline as re } from "../../components/SessionStatusTimeline.js";
|
|
14
16
|
import { safeExternalHref as g } from "../../utils/url.js";
|
|
15
|
-
import { useMemo as
|
|
16
|
-
import { ArrowLeft as
|
|
17
|
-
import { useParams as
|
|
18
|
-
import { jsx as
|
|
19
|
-
import { EmphasisPanel as
|
|
17
|
+
import { useMemo as ie, useState as _ } from "react";
|
|
18
|
+
import { ArrowLeft as ae, CalendarClock as v, CheckCircle2 as y, Clock as b, ExternalLink as x, Loader2 as S, Mail as C, MapPin as w, Video as oe, XCircle as se } from "lucide-react";
|
|
19
|
+
import { useParams as ce } from "react-router";
|
|
20
|
+
import { jsx as T, jsxs as E } from "react/jsx-runtime";
|
|
21
|
+
import { EmphasisPanel as le, GlassCard as D, ResponsiveDialog as ue, ResponsiveDialogContent as O, ResponsiveDialogFooter as k, ResponsiveDialogHeader as A, ResponsiveDialogTitle as j } from "@burdenoff/fe-libs/ui";
|
|
20
22
|
//#region src/atheletebridge/pages/sessions/SessionDetailPage.tsx
|
|
21
|
-
function
|
|
23
|
+
function M({ role: e, name: t, email: n, id: r }) {
|
|
22
24
|
let i = t?.trim() || `User ${r.slice(0, 6)}`;
|
|
23
|
-
return /* @__PURE__ */ D
|
|
25
|
+
return /* @__PURE__ */ E(D, {
|
|
24
26
|
treatment: "metric",
|
|
25
27
|
className: "p-4",
|
|
26
28
|
children: [
|
|
27
|
-
/* @__PURE__ */
|
|
29
|
+
/* @__PURE__ */ T("p", {
|
|
28
30
|
className: "text-xs font-medium uppercase tracking-wide text-text-muted",
|
|
29
31
|
children: e
|
|
30
32
|
}),
|
|
31
|
-
/* @__PURE__ */
|
|
33
|
+
/* @__PURE__ */ E("div", {
|
|
32
34
|
className: "mt-3 flex items-center gap-3",
|
|
33
|
-
children: [/* @__PURE__ */
|
|
35
|
+
children: [/* @__PURE__ */ T(c, {
|
|
34
36
|
name: t,
|
|
35
37
|
id: r,
|
|
36
38
|
size: "lg"
|
|
37
|
-
}), /* @__PURE__ */
|
|
39
|
+
}), /* @__PURE__ */ E("div", {
|
|
38
40
|
className: "min-w-0",
|
|
39
|
-
children: [/* @__PURE__ */
|
|
41
|
+
children: [/* @__PURE__ */ T("p", {
|
|
40
42
|
className: "truncate text-sm font-semibold text-text-primary",
|
|
41
43
|
children: i
|
|
42
|
-
}), /* @__PURE__ */
|
|
44
|
+
}), /* @__PURE__ */ T("p", {
|
|
43
45
|
className: "truncate text-xs text-text-secondary",
|
|
44
46
|
children: e
|
|
45
47
|
})]
|
|
46
48
|
})]
|
|
47
49
|
}),
|
|
48
|
-
n ? /* @__PURE__ */
|
|
50
|
+
n ? /* @__PURE__ */ E("a", {
|
|
49
51
|
href: `mailto:${n}`,
|
|
50
52
|
className: "mt-3 flex items-center gap-1.5 text-xs text-text-secondary hover:text-text-primary hover:underline",
|
|
51
|
-
children: [/* @__PURE__ */
|
|
53
|
+
children: [/* @__PURE__ */ T(C, {
|
|
52
54
|
className: "h-3.5 w-3.5 shrink-0",
|
|
53
55
|
"aria-hidden": "true"
|
|
54
|
-
}), /* @__PURE__ */
|
|
56
|
+
}), /* @__PURE__ */ T("span", {
|
|
55
57
|
className: "truncate",
|
|
56
58
|
children: n
|
|
57
59
|
})]
|
|
@@ -59,97 +61,97 @@ function P({ role: e, name: t, email: n, id: r }) {
|
|
|
59
61
|
]
|
|
60
62
|
});
|
|
61
63
|
}
|
|
62
|
-
function
|
|
63
|
-
let
|
|
64
|
-
if (
|
|
65
|
-
title:
|
|
66
|
-
children: /* @__PURE__ */
|
|
64
|
+
function N() {
|
|
65
|
+
let c = e(), { id: C } = ce(), { navigateTo: N } = t(), P = d(C), F = u(), I = l(), L = ne(), [R, z] = _(!1), [B, V] = _(""), [H, U] = _(0), [W, G] = _(null), K = p(P.data?.scheduledAt), q = f(ie(() => P.data ? [P.data.coachId, P.data.athleteId] : [], [P.data]));
|
|
66
|
+
if (P.isLoading) return /* @__PURE__ */ T(n, {
|
|
67
|
+
title: c("atheletebridge.pages.sessionDetail.title", "Session"),
|
|
68
|
+
children: /* @__PURE__ */ T(te, { label: c("atheletebridge.pages.sessionDetail.loading", "Loading session…") })
|
|
67
69
|
});
|
|
68
|
-
if (
|
|
69
|
-
title:
|
|
70
|
-
children: /* @__PURE__ */
|
|
71
|
-
title:
|
|
72
|
-
message:
|
|
73
|
-
onRetry: () =>
|
|
70
|
+
if (P.isError || !P.data) return /* @__PURE__ */ T(n, {
|
|
71
|
+
title: c("atheletebridge.pages.sessionDetail.title", "Session"),
|
|
72
|
+
children: /* @__PURE__ */ T(ee, {
|
|
73
|
+
title: c("atheletebridge.pages.sessionDetail.notFoundTitle", "Session not found"),
|
|
74
|
+
message: c("atheletebridge.pages.sessionDetail.notFoundMessage", "This session does not exist or you do not have access to it."),
|
|
75
|
+
onRetry: () => N("/sessions")
|
|
74
76
|
})
|
|
75
77
|
});
|
|
76
|
-
let
|
|
77
|
-
return /* @__PURE__ */
|
|
78
|
-
title:
|
|
79
|
-
description: a[
|
|
80
|
-
actions: /* @__PURE__ */
|
|
78
|
+
let J = P.data, Y = J.status === "REQUESTED", X = J.status === "CONFIRMED", Z = X && K, de = X && !K, Q = J.status === "REQUESTED" || J.status === "CONFIRMED", $ = g(J.meetingUrl);
|
|
79
|
+
return /* @__PURE__ */ E(n, {
|
|
80
|
+
title: J.title,
|
|
81
|
+
description: a[J.type],
|
|
82
|
+
actions: /* @__PURE__ */ E("button", {
|
|
81
83
|
type: "button",
|
|
82
|
-
onClick: () =>
|
|
84
|
+
onClick: () => N("/sessions"),
|
|
83
85
|
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",
|
|
84
86
|
children: [
|
|
85
|
-
/* @__PURE__ */
|
|
87
|
+
/* @__PURE__ */ T(ae, { className: "h-4 w-4" }),
|
|
86
88
|
" ",
|
|
87
|
-
|
|
89
|
+
c("atheletebridge.pages.sessionDetail.back", "Back")
|
|
88
90
|
]
|
|
89
91
|
}),
|
|
90
92
|
children: [
|
|
91
|
-
/* @__PURE__ */ D
|
|
93
|
+
/* @__PURE__ */ E(D, {
|
|
92
94
|
treatment: "insight",
|
|
93
95
|
className: "mb-6 p-5 sm:p-6",
|
|
94
|
-
children: [/* @__PURE__ */
|
|
96
|
+
children: [/* @__PURE__ */ E("div", {
|
|
95
97
|
className: "mb-5 flex items-center justify-between gap-3",
|
|
96
|
-
children: [/* @__PURE__ */
|
|
98
|
+
children: [/* @__PURE__ */ T("span", {
|
|
97
99
|
className: "text-xs font-medium uppercase tracking-wide text-text-muted",
|
|
98
|
-
children:
|
|
99
|
-
}), /* @__PURE__ */
|
|
100
|
-
}), /* @__PURE__ */
|
|
101
|
-
status:
|
|
102
|
-
createdAt:
|
|
103
|
-
completedAt:
|
|
100
|
+
children: c("atheletebridge.pages.sessionDetail.lifecycle", "Lifecycle")
|
|
101
|
+
}), /* @__PURE__ */ T(i, { status: J.status })]
|
|
102
|
+
}), /* @__PURE__ */ T(re, {
|
|
103
|
+
status: J.status,
|
|
104
|
+
createdAt: J.createdAt,
|
|
105
|
+
completedAt: J.completedAt
|
|
104
106
|
})]
|
|
105
107
|
}),
|
|
106
|
-
/* @__PURE__ */
|
|
108
|
+
/* @__PURE__ */ E("div", {
|
|
107
109
|
className: "mb-6 grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",
|
|
108
110
|
children: [
|
|
109
|
-
/* @__PURE__ */
|
|
110
|
-
role:
|
|
111
|
-
id:
|
|
112
|
-
name:
|
|
113
|
-
email:
|
|
111
|
+
/* @__PURE__ */ T(M, {
|
|
112
|
+
role: c("atheletebridge.pages.sessionDetail.coach", "Coach"),
|
|
113
|
+
id: J.coachId,
|
|
114
|
+
name: q.nameOf(J.coachId),
|
|
115
|
+
email: q.emailOf(J.coachId)
|
|
114
116
|
}),
|
|
115
|
-
/* @__PURE__ */
|
|
116
|
-
role:
|
|
117
|
-
id:
|
|
118
|
-
name:
|
|
119
|
-
email:
|
|
117
|
+
/* @__PURE__ */ T(M, {
|
|
118
|
+
role: c("atheletebridge.pages.sessionDetail.athlete", "Athlete"),
|
|
119
|
+
id: J.athleteId,
|
|
120
|
+
name: q.nameOf(J.athleteId),
|
|
121
|
+
email: q.emailOf(J.athleteId)
|
|
120
122
|
}),
|
|
121
|
-
/* @__PURE__ */ D
|
|
123
|
+
/* @__PURE__ */ E(D, {
|
|
122
124
|
treatment: "metric",
|
|
123
125
|
className: "p-4",
|
|
124
|
-
children: [/* @__PURE__ */
|
|
126
|
+
children: [/* @__PURE__ */ T("p", {
|
|
125
127
|
className: "text-xs font-medium uppercase tracking-wide text-text-muted",
|
|
126
|
-
children:
|
|
127
|
-
}), /* @__PURE__ */
|
|
128
|
+
children: c("atheletebridge.pages.sessionDetail.schedule", "Schedule")
|
|
129
|
+
}), /* @__PURE__ */ E("div", {
|
|
128
130
|
className: "mt-3 space-y-2.5 text-sm text-text-primary",
|
|
129
131
|
children: [
|
|
130
|
-
/* @__PURE__ */
|
|
132
|
+
/* @__PURE__ */ E("span", {
|
|
131
133
|
className: "flex items-center gap-2",
|
|
132
|
-
children: [/* @__PURE__ */
|
|
134
|
+
children: [/* @__PURE__ */ T(v, {
|
|
133
135
|
className: "h-4 w-4 shrink-0 text-text-secondary",
|
|
134
136
|
"aria-hidden": "true"
|
|
135
|
-
}), o(
|
|
137
|
+
}), o(J.scheduledAt)]
|
|
136
138
|
}),
|
|
137
|
-
/* @__PURE__ */
|
|
139
|
+
/* @__PURE__ */ E("span", {
|
|
138
140
|
className: "flex items-center gap-2 text-text-secondary",
|
|
139
|
-
children: [/* @__PURE__ */
|
|
141
|
+
children: [/* @__PURE__ */ T(b, {
|
|
140
142
|
className: "h-4 w-4 shrink-0",
|
|
141
143
|
"aria-hidden": "true"
|
|
142
|
-
}),
|
|
144
|
+
}), s(J.durationMin)]
|
|
143
145
|
}),
|
|
144
|
-
|
|
146
|
+
J.type === "IN_PERSON" && J.location ? /* @__PURE__ */ E("span", {
|
|
145
147
|
className: "flex items-center gap-2 text-text-secondary",
|
|
146
148
|
children: [
|
|
147
|
-
/* @__PURE__ */
|
|
149
|
+
/* @__PURE__ */ T(w, {
|
|
148
150
|
className: "h-4 w-4 shrink-0",
|
|
149
151
|
"aria-hidden": "true"
|
|
150
152
|
}),
|
|
151
153
|
" ",
|
|
152
|
-
|
|
154
|
+
J.location
|
|
153
155
|
]
|
|
154
156
|
}) : null
|
|
155
157
|
]
|
|
@@ -157,57 +159,57 @@ function F() {
|
|
|
157
159
|
})
|
|
158
160
|
]
|
|
159
161
|
}),
|
|
160
|
-
/* @__PURE__ */
|
|
162
|
+
/* @__PURE__ */ E("div", {
|
|
161
163
|
className: "grid grid-cols-1 gap-6 lg:grid-cols-2",
|
|
162
|
-
children: [/* @__PURE__ */
|
|
164
|
+
children: [/* @__PURE__ */ T("div", {
|
|
163
165
|
className: "space-y-6",
|
|
164
|
-
children: /* @__PURE__ */ D
|
|
166
|
+
children: /* @__PURE__ */ E(D, {
|
|
165
167
|
treatment: "glass",
|
|
166
168
|
className: "p-5 sm:p-6",
|
|
167
169
|
children: [
|
|
168
|
-
/* @__PURE__ */
|
|
170
|
+
/* @__PURE__ */ T("h2", {
|
|
169
171
|
className: "text-sm font-semibold text-text-primary",
|
|
170
|
-
children:
|
|
172
|
+
children: c("atheletebridge.pages.sessionDetail.sessionDetails", "Session details")
|
|
171
173
|
}),
|
|
172
|
-
/* @__PURE__ */
|
|
174
|
+
/* @__PURE__ */ E("p", {
|
|
173
175
|
className: "mt-2 text-sm text-text-secondary",
|
|
174
176
|
children: [
|
|
175
|
-
a[
|
|
177
|
+
a[J.type],
|
|
176
178
|
" ",
|
|
177
|
-
|
|
178
|
-
|
|
179
|
+
c("atheletebridge.pages.sessionDetail.sessionTypeSuffix", "session"),
|
|
180
|
+
J.location ? ` · ${J.location}` : "",
|
|
179
181
|
"."
|
|
180
182
|
]
|
|
181
183
|
}),
|
|
182
|
-
$ ? /* @__PURE__ */
|
|
184
|
+
$ ? /* @__PURE__ */ E("a", {
|
|
183
185
|
href: $,
|
|
184
186
|
target: "_blank",
|
|
185
187
|
rel: "noopener noreferrer",
|
|
186
188
|
className: "mt-4 flex items-center gap-3 rounded-xl border border-border-seam bg-bg-sunken p-3 transition-colors hover:bg-bg-surface focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
|
|
187
189
|
children: [
|
|
188
|
-
/* @__PURE__ */
|
|
190
|
+
/* @__PURE__ */ T("span", {
|
|
189
191
|
className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-text-primary",
|
|
190
|
-
children: /* @__PURE__ */
|
|
192
|
+
children: /* @__PURE__ */ T(oe, {
|
|
191
193
|
className: "h-5 w-5",
|
|
192
194
|
"aria-hidden": "true"
|
|
193
195
|
})
|
|
194
196
|
}),
|
|
195
|
-
/* @__PURE__ */
|
|
197
|
+
/* @__PURE__ */ E("span", {
|
|
196
198
|
className: "min-w-0 flex-1",
|
|
197
|
-
children: [/* @__PURE__ */
|
|
199
|
+
children: [/* @__PURE__ */ T("span", {
|
|
198
200
|
className: "block text-sm font-medium text-text-primary",
|
|
199
|
-
children:
|
|
200
|
-
}), /* @__PURE__ */
|
|
201
|
+
children: c("atheletebridge.pages.sessionDetail.meetingLink", "Meeting link")
|
|
202
|
+
}), /* @__PURE__ */ T("span", {
|
|
201
203
|
className: "block truncate text-xs text-text-secondary",
|
|
202
|
-
children:
|
|
204
|
+
children: c("atheletebridge.pages.sessionDetail.onlineSessionHint", "Online session — tap to join")
|
|
203
205
|
})]
|
|
204
206
|
}),
|
|
205
|
-
/* @__PURE__ */
|
|
207
|
+
/* @__PURE__ */ E("span", {
|
|
206
208
|
className: "inline-flex items-center gap-1 text-sm font-medium text-text-link",
|
|
207
209
|
children: [
|
|
208
|
-
|
|
210
|
+
c("atheletebridge.pages.sessionDetail.join", "Join"),
|
|
209
211
|
" ",
|
|
210
|
-
/* @__PURE__ */
|
|
212
|
+
/* @__PURE__ */ T(x, {
|
|
211
213
|
className: "h-4 w-4",
|
|
212
214
|
"aria-hidden": "true"
|
|
213
215
|
})
|
|
@@ -215,34 +217,34 @@ function F() {
|
|
|
215
217
|
})
|
|
216
218
|
]
|
|
217
219
|
}) : null,
|
|
218
|
-
|
|
220
|
+
J.completedAt ? /* @__PURE__ */ E("div", {
|
|
219
221
|
className: "mt-5 border-t border-border-seam pt-5",
|
|
220
222
|
children: [
|
|
221
|
-
/* @__PURE__ */
|
|
223
|
+
/* @__PURE__ */ T("h3", {
|
|
222
224
|
className: "mb-2 text-sm font-semibold text-text-primary",
|
|
223
|
-
children:
|
|
225
|
+
children: c("atheletebridge.pages.sessionDetail.outcome", "Outcome")
|
|
224
226
|
}),
|
|
225
|
-
/* @__PURE__ */
|
|
227
|
+
/* @__PURE__ */ E("p", {
|
|
226
228
|
className: "text-sm text-text-secondary",
|
|
227
229
|
children: [
|
|
228
|
-
|
|
230
|
+
c("atheletebridge.pages.sessionDetail.completed", "Completed"),
|
|
229
231
|
" ",
|
|
230
|
-
o(
|
|
232
|
+
o(J.completedAt)
|
|
231
233
|
]
|
|
232
234
|
}),
|
|
233
|
-
|
|
235
|
+
J.rating === null ? null : /* @__PURE__ */ T("div", {
|
|
234
236
|
className: "mt-2",
|
|
235
|
-
children: /* @__PURE__ */
|
|
236
|
-
value:
|
|
237
|
+
children: /* @__PURE__ */ T(r, {
|
|
238
|
+
value: J.rating,
|
|
237
239
|
size: 18,
|
|
238
240
|
showValue: !0
|
|
239
241
|
})
|
|
240
242
|
}),
|
|
241
|
-
|
|
243
|
+
J.feedback ? /* @__PURE__ */ E("p", {
|
|
242
244
|
className: "mt-3 rounded-lg bg-bg-sunken p-3 text-sm italic text-text-secondary",
|
|
243
245
|
children: [
|
|
244
246
|
"“",
|
|
245
|
-
|
|
247
|
+
J.feedback,
|
|
246
248
|
"”"
|
|
247
249
|
]
|
|
248
250
|
}) : null
|
|
@@ -250,114 +252,117 @@ function F() {
|
|
|
250
252
|
}) : null
|
|
251
253
|
]
|
|
252
254
|
})
|
|
253
|
-
}),
|
|
255
|
+
}), Y || Z || Q ? /* @__PURE__ */ E(le, {
|
|
254
256
|
className: "h-fit",
|
|
255
257
|
children: [
|
|
256
|
-
/* @__PURE__ */
|
|
258
|
+
/* @__PURE__ */ T("h2", {
|
|
257
259
|
className: "mb-4 text-sm font-semibold text-text-primary",
|
|
258
|
-
children:
|
|
260
|
+
children: c("atheletebridge.pages.sessionDetail.actions", "Actions")
|
|
259
261
|
}),
|
|
260
|
-
/* @__PURE__ */
|
|
262
|
+
/* @__PURE__ */ E("div", {
|
|
261
263
|
className: "flex flex-col gap-2.5",
|
|
262
264
|
children: [
|
|
263
|
-
|
|
265
|
+
Y && /* @__PURE__ */ E("button", {
|
|
264
266
|
type: "button",
|
|
265
|
-
onClick: () =>
|
|
266
|
-
disabled:
|
|
267
|
+
onClick: () => C && F.mutate(C),
|
|
268
|
+
disabled: F.isPending,
|
|
267
269
|
className: "inline-flex w-full items-center justify-center gap-2 rounded-lg bg-action-primary-bg px-4 py-2.5 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90 disabled:opacity-60",
|
|
268
|
-
children: [
|
|
270
|
+
children: [F.isPending ? /* @__PURE__ */ T(S, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ T(y, { className: "h-4 w-4" }), c("atheletebridge.pages.sessionDetail.confirm", "Confirm")]
|
|
269
271
|
}),
|
|
270
|
-
Z && /* @__PURE__ */
|
|
272
|
+
Z && /* @__PURE__ */ E("button", {
|
|
271
273
|
type: "button",
|
|
272
274
|
onClick: () => {
|
|
273
|
-
|
|
275
|
+
G(null), V(J.feedback ?? ""), U(J.rating ?? 0), z(!0);
|
|
274
276
|
},
|
|
275
277
|
className: "inline-flex w-full items-center justify-center gap-2 rounded-lg bg-status-success-bg-subtle px-4 py-2.5 text-sm font-medium text-status-success-text ring-1 ring-inset ring-status-success-border transition-colors hover:bg-status-success-bg-subtle/70",
|
|
276
278
|
children: [
|
|
277
|
-
/* @__PURE__ */
|
|
279
|
+
/* @__PURE__ */ T(y, { className: "h-4 w-4" }),
|
|
278
280
|
" ",
|
|
279
|
-
|
|
281
|
+
c("atheletebridge.pages.sessionDetail.complete", "Complete")
|
|
280
282
|
]
|
|
281
283
|
}),
|
|
282
|
-
Q && /* @__PURE__ */
|
|
284
|
+
Q && /* @__PURE__ */ E("button", {
|
|
283
285
|
type: "button",
|
|
284
|
-
onClick: () =>
|
|
285
|
-
disabled:
|
|
286
|
+
onClick: () => C && L.mutate(C),
|
|
287
|
+
disabled: L.isPending,
|
|
286
288
|
className: "inline-flex w-full items-center justify-center gap-2 rounded-lg border border-status-error-border px-4 py-2.5 text-sm font-medium text-status-error-text transition-colors hover:bg-status-error-bg-subtle disabled:opacity-60",
|
|
287
|
-
children: [
|
|
289
|
+
children: [L.isPending ? /* @__PURE__ */ T(S, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ T(se, { className: "h-4 w-4" }), c("atheletebridge.pages.sessionDetail.cancelSession", "Cancel session")]
|
|
288
290
|
})
|
|
289
291
|
]
|
|
290
292
|
}),
|
|
291
|
-
Z ? /* @__PURE__ */
|
|
293
|
+
Z ? /* @__PURE__ */ T("p", {
|
|
294
|
+
className: "mt-3 text-xs text-text-muted",
|
|
295
|
+
children: c("atheletebridge.pages.sessionDetail.completeTooltip", "Completing lets you leave feedback and a 1–5 star rating for the athlete.")
|
|
296
|
+
}) : de ? /* @__PURE__ */ T("p", {
|
|
292
297
|
className: "mt-3 text-xs text-text-muted",
|
|
293
|
-
children:
|
|
298
|
+
children: c("atheletebridge.pages.sessionDetail.completeUnavailable", "This session can be completed once its scheduled date and time arrives.")
|
|
294
299
|
}) : null
|
|
295
300
|
]
|
|
296
301
|
}) : null]
|
|
297
302
|
}),
|
|
298
|
-
/* @__PURE__ */
|
|
299
|
-
open:
|
|
300
|
-
onOpenChange:
|
|
301
|
-
children: /* @__PURE__ */
|
|
303
|
+
/* @__PURE__ */ T(ue, {
|
|
304
|
+
open: R,
|
|
305
|
+
onOpenChange: z,
|
|
306
|
+
children: /* @__PURE__ */ E(O, { children: [/* @__PURE__ */ T(A, { children: /* @__PURE__ */ T(j, { children: c("atheletebridge.pages.sessionDetail.completeDialogTitle", "Complete session") }) }), /* @__PURE__ */ E("form", {
|
|
302
307
|
onSubmit: async (e) => {
|
|
303
|
-
if (e.preventDefault(),
|
|
304
|
-
let t =
|
|
308
|
+
if (e.preventDefault(), G(null), !C) return;
|
|
309
|
+
let t = H > 0 ? H : void 0;
|
|
305
310
|
if (t !== void 0 && (t < 1 || t > 5)) {
|
|
306
|
-
|
|
311
|
+
G("Rating must be between 1 and 5.");
|
|
307
312
|
return;
|
|
308
313
|
}
|
|
309
314
|
try {
|
|
310
|
-
await
|
|
311
|
-
id:
|
|
315
|
+
await I.mutateAsync({
|
|
316
|
+
id: C,
|
|
312
317
|
input: {
|
|
313
|
-
feedback:
|
|
318
|
+
feedback: B.trim() || void 0,
|
|
314
319
|
rating: t
|
|
315
320
|
}
|
|
316
|
-
}),
|
|
321
|
+
}), z(!1);
|
|
317
322
|
} catch (e) {
|
|
318
|
-
|
|
323
|
+
G(e instanceof Error ? e.message : "Failed to complete session.");
|
|
319
324
|
}
|
|
320
325
|
},
|
|
321
326
|
className: "space-y-4 px-1",
|
|
322
327
|
children: [
|
|
323
|
-
/* @__PURE__ */
|
|
324
|
-
label:
|
|
328
|
+
/* @__PURE__ */ T(m, {
|
|
329
|
+
label: c("atheletebridge.pages.sessionDetail.feedbackLabel", "Feedback"),
|
|
325
330
|
htmlFor: "feedback",
|
|
326
|
-
hint:
|
|
327
|
-
children: /* @__PURE__ */
|
|
331
|
+
hint: c("atheletebridge.pages.sessionDetail.feedbackHint", "Optional post-session notes."),
|
|
332
|
+
children: /* @__PURE__ */ T("textarea", {
|
|
328
333
|
id: "feedback",
|
|
329
|
-
className:
|
|
334
|
+
className: h,
|
|
330
335
|
rows: 3,
|
|
331
|
-
value:
|
|
332
|
-
onChange: (e) =>
|
|
333
|
-
placeholder:
|
|
336
|
+
value: B,
|
|
337
|
+
onChange: (e) => V(e.target.value),
|
|
338
|
+
placeholder: c("atheletebridge.pages.sessionDetail.feedbackPlaceholder", "How did the session go?")
|
|
334
339
|
})
|
|
335
340
|
}),
|
|
336
|
-
/* @__PURE__ */
|
|
337
|
-
label:
|
|
338
|
-
hint:
|
|
339
|
-
children: /* @__PURE__ */
|
|
340
|
-
value:
|
|
341
|
-
onChange:
|
|
341
|
+
/* @__PURE__ */ T(m, {
|
|
342
|
+
label: c("atheletebridge.pages.sessionDetail.ratingLabel", "Rating"),
|
|
343
|
+
hint: c("atheletebridge.pages.sessionDetail.ratingHint", "Optional — tap a star."),
|
|
344
|
+
children: /* @__PURE__ */ T(r, {
|
|
345
|
+
value: H,
|
|
346
|
+
onChange: U,
|
|
342
347
|
size: 30,
|
|
343
348
|
showLabels: !0,
|
|
344
|
-
ariaLabel:
|
|
349
|
+
ariaLabel: c("atheletebridge.pages.sessionDetail.ratingAria", "Rate this session out of 5")
|
|
345
350
|
})
|
|
346
351
|
}),
|
|
347
|
-
|
|
352
|
+
W && /* @__PURE__ */ T("p", {
|
|
348
353
|
className: "text-sm text-status-error-text",
|
|
349
|
-
children:
|
|
354
|
+
children: W
|
|
350
355
|
}),
|
|
351
|
-
/* @__PURE__ */
|
|
356
|
+
/* @__PURE__ */ E(k, { children: [/* @__PURE__ */ T("button", {
|
|
352
357
|
type: "button",
|
|
353
|
-
onClick: () =>
|
|
358
|
+
onClick: () => z(!1),
|
|
354
359
|
className: "rounded-lg border border-border-seam px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken",
|
|
355
|
-
children:
|
|
356
|
-
}), /* @__PURE__ */
|
|
360
|
+
children: c("common.cancel", "Cancel")
|
|
361
|
+
}), /* @__PURE__ */ E("button", {
|
|
357
362
|
type: "submit",
|
|
358
|
-
disabled:
|
|
363
|
+
disabled: I.isPending,
|
|
359
364
|
className: "inline-flex items-center gap-1.5 rounded-lg bg-status-success-bg-subtle px-4 py-2 text-sm font-medium text-status-success-text ring-1 ring-inset ring-status-success-border transition-colors hover:bg-status-success-bg-subtle/70 disabled:opacity-60",
|
|
360
|
-
children: [
|
|
365
|
+
children: [I.isPending && /* @__PURE__ */ T(S, { className: "h-4 w-4 animate-spin" }), c("atheletebridge.pages.sessionDetail.completeAction", "Complete session")]
|
|
361
366
|
})] })
|
|
362
367
|
]
|
|
363
368
|
})] })
|
|
@@ -366,6 +371,6 @@ function F() {
|
|
|
366
371
|
});
|
|
367
372
|
}
|
|
368
373
|
//#endregion
|
|
369
|
-
export {
|
|
374
|
+
export { N as SessionDetailPage };
|
|
370
375
|
|
|
371
376
|
//# sourceMappingURL=SessionDetailPage.js.map
|