@burdenoff/microfe-technospam 2026.730.1 → 2026.730.3
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/technospam/api/technospamApi.d.ts +46 -0
- package/dist/technospam/api/technospamApi.d.ts.map +1 -1
- package/dist/technospam/api/technospamApi.js +190 -139
- package/dist/technospam/api/technospamApi.js.map +1 -1
- package/dist/technospam/pages/AdminAdminDashboardPagePage.d.ts.map +1 -1
- package/dist/technospam/pages/AdminAdminDashboardPagePage.js +256 -256
- package/dist/technospam/pages/AdminAdminDashboardPagePage.js.map +1 -1
- package/dist/technospam/pages/MentorshipMentorProfilePagePage.d.ts.map +1 -1
- package/dist/technospam/pages/MentorshipMentorProfilePagePage.js +152 -111
- package/dist/technospam/pages/MentorshipMentorProfilePagePage.js.map +1 -1
- package/dist/technospam/pages/MentorshipMentorsPagePage.d.ts.map +1 -1
- package/dist/technospam/pages/MentorshipMentorsPagePage.js +6 -5
- package/dist/technospam/pages/MentorshipMentorsPagePage.js.map +1 -1
- package/dist/technospam/utils/format.d.ts +12 -0
- package/dist/technospam/utils/format.d.ts.map +1 -1
- package/dist/technospam/utils/format.js +14 -3
- package/dist/technospam/utils/format.js.map +1 -1
- package/package.json +1 -1
|
@@ -4,140 +4,181 @@ import { cn as n } from "../utils/cn.js";
|
|
|
4
4
|
import { PageLayout as r } from "../components/PageLayout.js";
|
|
5
5
|
import { StatCard as i } from "../components/StatCard.js";
|
|
6
6
|
import { coverGradient as a, topicIcon as o } from "../components/MediaCover.js";
|
|
7
|
-
import { formatDateTime as s, formatDuration as c,
|
|
7
|
+
import { formatDateTime as s, formatDuration as c, formatMoneyFromMinorUnits as l } from "../utils/format.js";
|
|
8
8
|
import { StatusBadge as u } from "../components/StatusBadge.js";
|
|
9
9
|
import { EmptyView as d, ErrorView as f } from "../components/StateViews.js";
|
|
10
10
|
import "../components/index.js";
|
|
11
11
|
import { notify as p } from "../lib/toast.js";
|
|
12
|
-
import { useBookSession as m, useMentorQuery as h } from "../api/technospamApi.js";
|
|
13
|
-
import { createElement as
|
|
14
|
-
import { Award as
|
|
15
|
-
import { useSearchParams as
|
|
16
|
-
import { jsx as
|
|
17
|
-
import { Badge as
|
|
12
|
+
import { useBookSession as m, useMentorQuery as h, useSessionCostEstimate as g } from "../api/technospamApi.js";
|
|
13
|
+
import { createElement as _, useState as v } from "react";
|
|
14
|
+
import { Award as y, CalendarClock as b, CreditCard as x, DollarSign as S, MessageSquare as C, Star as w, Video as T } from "lucide-react";
|
|
15
|
+
import { useSearchParams as E } from "react-router-dom";
|
|
16
|
+
import { Fragment as D, jsx as O, jsxs as k } from "react/jsx-runtime";
|
|
17
|
+
import { Badge as A, Button as j, GlassCard as M, Input as N, Skeleton as P, Textarea as F } from "@burdenoff/fe-libs/ui";
|
|
18
18
|
//#region src/technospam/pages/MentorshipMentorProfilePagePage.tsx
|
|
19
|
-
function
|
|
20
|
-
let [a, o] =
|
|
21
|
-
return /* @__PURE__ */
|
|
19
|
+
function I({ mentorId: e, disabled: n, onBooked: r, workspaceId: i }) {
|
|
20
|
+
let [a, o] = v(""), [s, c] = v(""), [u, d] = v(""), [f, h] = v("60"), [_, { loading: y }] = m(), { emit: S } = t(), C = u ? new Date(u) : null, w = C != null && !Number.isNaN(C.getTime()), T = a.trim().length > 0 && w && !y && !n, E = Number.parseInt(f, 10), { data: A, loading: I } = g(e, Number.isNaN(E) ? 0 : E), L = A?.tecCalculateSessionCost;
|
|
21
|
+
return /* @__PURE__ */ k(M, {
|
|
22
22
|
className: "p-5",
|
|
23
23
|
children: [
|
|
24
|
-
/* @__PURE__ */
|
|
24
|
+
/* @__PURE__ */ k("div", {
|
|
25
25
|
className: "mb-4 flex items-start gap-3",
|
|
26
|
-
children: [/* @__PURE__ */
|
|
26
|
+
children: [/* @__PURE__ */ O("span", {
|
|
27
27
|
className: "flex h-11 w-11 shrink-0 items-center justify-center rounded-xl bg-gradient-to-br from-accent-primary to-accent-purple text-white shadow-sm",
|
|
28
|
-
children: /* @__PURE__ */
|
|
29
|
-
}), /* @__PURE__ */
|
|
28
|
+
children: /* @__PURE__ */ O(b, { size: 20 })
|
|
29
|
+
}), /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("h2", {
|
|
30
30
|
className: "text-base font-semibold text-text-primary",
|
|
31
31
|
children: "Book a session"
|
|
32
|
-
}), /* @__PURE__ */
|
|
32
|
+
}), /* @__PURE__ */ O("p", {
|
|
33
33
|
className: "text-sm text-text-secondary",
|
|
34
34
|
children: "Schedule 1:1 time with your mentor."
|
|
35
35
|
})] })]
|
|
36
36
|
}),
|
|
37
|
-
n ? /* @__PURE__ */
|
|
37
|
+
n ? /* @__PURE__ */ O("p", {
|
|
38
38
|
className: "rounded-lg border border-border-seam bg-bg-sunken px-3 py-2 text-sm text-text-secondary",
|
|
39
39
|
children: "This mentor isn't accepting new mentees right now."
|
|
40
40
|
}) : null,
|
|
41
|
-
/* @__PURE__ */
|
|
41
|
+
/* @__PURE__ */ k("div", {
|
|
42
42
|
className: "mt-4 grid grid-cols-1 gap-4",
|
|
43
43
|
children: [
|
|
44
|
-
/* @__PURE__ */
|
|
44
|
+
/* @__PURE__ */ k("div", { children: [/* @__PURE__ */ k("label", {
|
|
45
45
|
className: "mb-1.5 block text-sm font-medium text-text-primary",
|
|
46
|
-
children: ["Topic ", /* @__PURE__ */
|
|
46
|
+
children: ["Topic ", /* @__PURE__ */ O("span", {
|
|
47
47
|
className: "text-status-error-text",
|
|
48
48
|
children: "*"
|
|
49
49
|
})]
|
|
50
|
-
}), /* @__PURE__ */
|
|
50
|
+
}), /* @__PURE__ */ O(N, {
|
|
51
51
|
placeholder: "e.g. System design interview prep",
|
|
52
52
|
value: a,
|
|
53
53
|
onChange: (e) => o(e.target.value),
|
|
54
54
|
disabled: n
|
|
55
55
|
})] }),
|
|
56
|
-
/* @__PURE__ */
|
|
56
|
+
/* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("label", {
|
|
57
57
|
className: "mb-1.5 block text-sm font-medium text-text-primary",
|
|
58
58
|
children: "Agenda"
|
|
59
|
-
}), /* @__PURE__ */
|
|
59
|
+
}), /* @__PURE__ */ O(F, {
|
|
60
60
|
rows: 3,
|
|
61
61
|
placeholder: "What would you like to cover? Share context so your mentor can prepare.",
|
|
62
62
|
value: s,
|
|
63
63
|
onChange: (e) => c(e.target.value),
|
|
64
64
|
disabled: n
|
|
65
65
|
})] }),
|
|
66
|
-
/* @__PURE__ */
|
|
66
|
+
/* @__PURE__ */ k("div", {
|
|
67
67
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
68
|
-
children: [/* @__PURE__ */
|
|
68
|
+
children: [/* @__PURE__ */ k("div", { children: [/* @__PURE__ */ k("label", {
|
|
69
69
|
className: "mb-1.5 block text-sm font-medium text-text-primary",
|
|
70
|
-
children: ["When ", /* @__PURE__ */
|
|
70
|
+
children: ["When ", /* @__PURE__ */ O("span", {
|
|
71
71
|
className: "text-status-error-text",
|
|
72
72
|
children: "*"
|
|
73
73
|
})]
|
|
74
|
-
}), /* @__PURE__ */
|
|
74
|
+
}), /* @__PURE__ */ O(N, {
|
|
75
75
|
type: "datetime-local",
|
|
76
|
-
value:
|
|
77
|
-
onChange: (e) =>
|
|
76
|
+
value: u,
|
|
77
|
+
onChange: (e) => d(e.target.value),
|
|
78
78
|
disabled: n
|
|
79
|
-
})] }), /* @__PURE__ */
|
|
79
|
+
})] }), /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("label", {
|
|
80
80
|
className: "mb-1.5 block text-sm font-medium text-text-primary",
|
|
81
81
|
children: "Duration (min)"
|
|
82
|
-
}), /* @__PURE__ */
|
|
82
|
+
}), /* @__PURE__ */ O(N, {
|
|
83
83
|
type: "number",
|
|
84
84
|
min: 15,
|
|
85
85
|
step: 15,
|
|
86
|
-
value:
|
|
87
|
-
onChange: (e) =>
|
|
86
|
+
value: f,
|
|
87
|
+
onChange: (e) => h(e.target.value),
|
|
88
88
|
disabled: n
|
|
89
89
|
})] })]
|
|
90
90
|
}),
|
|
91
|
-
/* @__PURE__ */
|
|
91
|
+
/* @__PURE__ */ O("div", {
|
|
92
|
+
className: "rounded-lg border border-border-seam bg-bg-sunken px-3 py-2.5",
|
|
93
|
+
children: I && !L ? /* @__PURE__ */ O(P, { className: "h-5 w-40 rounded" }) : L ? /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ k("div", {
|
|
94
|
+
className: "flex items-center justify-between text-sm",
|
|
95
|
+
children: [/* @__PURE__ */ O("span", {
|
|
96
|
+
className: "text-text-secondary",
|
|
97
|
+
children: "Session cost"
|
|
98
|
+
}), /* @__PURE__ */ O("span", {
|
|
99
|
+
className: "font-semibold text-text-primary",
|
|
100
|
+
children: l(L.costAmount, L.currency)
|
|
101
|
+
})]
|
|
102
|
+
}), /* @__PURE__ */ k("p", {
|
|
103
|
+
className: "mt-0.5 text-xs text-text-muted",
|
|
104
|
+
children: [
|
|
105
|
+
"Includes a ",
|
|
106
|
+
(L.platformFeeBps / 100).toFixed(0),
|
|
107
|
+
"% platform fee (",
|
|
108
|
+
l(L.platformFeeAmount, L.currency),
|
|
109
|
+
") — the mentor keeps",
|
|
110
|
+
" ",
|
|
111
|
+
l(L.netAmount, L.currency),
|
|
112
|
+
"."
|
|
113
|
+
]
|
|
114
|
+
})] }) : /* @__PURE__ */ O("p", {
|
|
115
|
+
className: "text-sm text-text-muted",
|
|
116
|
+
children: "Enter a duration to preview the session cost."
|
|
117
|
+
})
|
|
118
|
+
}),
|
|
119
|
+
/* @__PURE__ */ k(j, {
|
|
92
120
|
className: "w-full bg-gradient-to-r from-accent-primary to-accent-purple",
|
|
93
121
|
onClick: async () => {
|
|
94
|
-
if (!
|
|
122
|
+
if (!T || !C) return;
|
|
95
123
|
let t = {
|
|
96
124
|
mentorId: e,
|
|
97
125
|
topic: a.trim(),
|
|
98
|
-
scheduledAt:
|
|
126
|
+
scheduledAt: C.toISOString()
|
|
99
127
|
};
|
|
100
128
|
s.trim() && (t.agenda = s.trim());
|
|
101
|
-
let n = Number.parseInt(
|
|
102
|
-
!Number.isNaN(n) && n > 0 && (t.durationMinutes = n),
|
|
129
|
+
let n = Number.parseInt(f, 10);
|
|
130
|
+
!Number.isNaN(n) && n > 0 && (t.durationMinutes = n), S("technospam.mentor.book_clicked", {
|
|
103
131
|
workspaceId: i,
|
|
104
132
|
entityId: e,
|
|
105
133
|
entityType: "TEC_MENTOR"
|
|
106
134
|
});
|
|
107
|
-
let l = await
|
|
108
|
-
l.data?.tecBookSession && (
|
|
135
|
+
let l = await _({ variables: { input: t } });
|
|
136
|
+
l.data?.tecBookSession && (S("technospam.mentor.booked", {
|
|
109
137
|
workspaceId: i,
|
|
110
138
|
entityId: e,
|
|
111
139
|
entityType: "TEC_MENTOR",
|
|
112
140
|
sessionId: l.data.tecBookSession.id
|
|
113
|
-
}), p.success("Session requested", "Your mentor will confirm the booking soon."), o(""), c(""),
|
|
141
|
+
}), p.success("Session requested", "Your mentor will confirm the booking soon."), o(""), c(""), d(""), h("60"), r?.());
|
|
114
142
|
},
|
|
115
|
-
disabled: !
|
|
143
|
+
disabled: !T,
|
|
116
144
|
children: [
|
|
117
|
-
/* @__PURE__ */
|
|
145
|
+
/* @__PURE__ */ O(b, { size: 16 }),
|
|
118
146
|
" ",
|
|
119
|
-
|
|
147
|
+
y ? "Requesting…" : "Request session"
|
|
120
148
|
]
|
|
149
|
+
}),
|
|
150
|
+
/* @__PURE__ */ k("div", {
|
|
151
|
+
className: "flex items-center justify-between gap-2 rounded-lg border border-border-seam px-3 py-2",
|
|
152
|
+
children: [/* @__PURE__ */ k("span", {
|
|
153
|
+
className: "flex items-center gap-1.5 text-xs text-text-muted",
|
|
154
|
+
children: [/* @__PURE__ */ O(x, { size: 14 }), " Payment integration pending"]
|
|
155
|
+
}), /* @__PURE__ */ O(j, {
|
|
156
|
+
variant: "outline",
|
|
157
|
+
size: "sm",
|
|
158
|
+
disabled: !0,
|
|
159
|
+
title: "Online payment collection is not live yet",
|
|
160
|
+
children: "Pay now"
|
|
161
|
+
})]
|
|
121
162
|
})
|
|
122
163
|
]
|
|
123
164
|
})
|
|
124
165
|
]
|
|
125
166
|
});
|
|
126
167
|
}
|
|
127
|
-
function
|
|
128
|
-
return /* @__PURE__ */
|
|
168
|
+
function L({ session: e }) {
|
|
169
|
+
return /* @__PURE__ */ k("div", {
|
|
129
170
|
className: "flex items-center gap-3 rounded-lg px-1 py-3 transition-colors hover:bg-bg-sunken",
|
|
130
171
|
children: [
|
|
131
|
-
/* @__PURE__ */
|
|
172
|
+
/* @__PURE__ */ O("span", {
|
|
132
173
|
className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-accent-purple/12 text-accent-purple",
|
|
133
|
-
children: /* @__PURE__ */ T
|
|
174
|
+
children: /* @__PURE__ */ O(T, { size: 16 })
|
|
134
175
|
}),
|
|
135
|
-
/* @__PURE__ */
|
|
176
|
+
/* @__PURE__ */ k("div", {
|
|
136
177
|
className: "min-w-0 flex-1",
|
|
137
|
-
children: [/* @__PURE__ */
|
|
178
|
+
children: [/* @__PURE__ */ O("div", {
|
|
138
179
|
className: "truncate text-sm font-medium text-text-primary",
|
|
139
180
|
children: e.topic
|
|
140
|
-
}), /* @__PURE__ */
|
|
181
|
+
}), /* @__PURE__ */ k("div", {
|
|
141
182
|
className: "text-xs text-text-muted",
|
|
142
183
|
children: [
|
|
143
184
|
s(e.scheduledAt),
|
|
@@ -146,86 +187,86 @@ function P({ session: e }) {
|
|
|
146
187
|
]
|
|
147
188
|
})]
|
|
148
189
|
}),
|
|
149
|
-
/* @__PURE__ */
|
|
190
|
+
/* @__PURE__ */ O(u, { status: e.status })
|
|
150
191
|
]
|
|
151
192
|
});
|
|
152
193
|
}
|
|
153
|
-
function
|
|
154
|
-
let [t] =
|
|
155
|
-
if (m && !
|
|
194
|
+
function R() {
|
|
195
|
+
let [t] = E(), s = t.get("id") ?? "", { workspaceId: c } = e(), { data: p, loading: m, error: g, refetch: v } = h(s), x = p?.tecMentor ?? null;
|
|
196
|
+
if (m && !x) return /* @__PURE__ */ k(r, {
|
|
156
197
|
title: "Mentor",
|
|
157
198
|
backPath: "/mentorship/mentors-page",
|
|
158
|
-
children: [/* @__PURE__ */
|
|
199
|
+
children: [/* @__PURE__ */ O(P, { className: "mb-4 h-40 w-full rounded-xl" }), /* @__PURE__ */ O(P, { className: "h-64 w-full rounded-xl" })]
|
|
159
200
|
});
|
|
160
|
-
if (
|
|
201
|
+
if (g || !x) return /* @__PURE__ */ O(r, {
|
|
161
202
|
title: "Mentor",
|
|
162
203
|
backPath: "/mentorship/mentors-page",
|
|
163
|
-
children:
|
|
204
|
+
children: g ? /* @__PURE__ */ O(f, {
|
|
164
205
|
title: "Couldn't load mentor",
|
|
165
|
-
error:
|
|
166
|
-
}) : /* @__PURE__ */
|
|
206
|
+
error: g
|
|
207
|
+
}) : /* @__PURE__ */ O(d, {
|
|
167
208
|
title: "Mentor not found",
|
|
168
209
|
description: "This mentor profile may no longer be available."
|
|
169
210
|
})
|
|
170
211
|
});
|
|
171
|
-
let
|
|
172
|
-
return /* @__PURE__ */
|
|
212
|
+
let T = [...x.sessions ?? []].sort((e, t) => new Date(t.scheduledAt).getTime() - new Date(e.scheduledAt).getTime()).slice(0, 5), D = o(x.expertise.join(" ") || x.headline);
|
|
213
|
+
return /* @__PURE__ */ k(r, {
|
|
173
214
|
hero: !0,
|
|
174
215
|
backPath: "/mentorship/mentors-page",
|
|
175
216
|
title: "Mentor Profile",
|
|
176
217
|
children: [
|
|
177
|
-
/* @__PURE__ */
|
|
218
|
+
/* @__PURE__ */ k(M, {
|
|
178
219
|
className: "mb-6 overflow-hidden p-0",
|
|
179
|
-
children: [/* @__PURE__ */
|
|
180
|
-
className: n("relative h-24 overflow-hidden bg-gradient-to-br", a(
|
|
181
|
-
children: [
|
|
220
|
+
children: [/* @__PURE__ */ k("div", {
|
|
221
|
+
className: n("relative h-24 overflow-hidden bg-gradient-to-br", a(x.headline)),
|
|
222
|
+
children: [_(D, {
|
|
182
223
|
className: "pointer-events-none absolute -right-3 -top-4 text-white/15",
|
|
183
224
|
size: 120,
|
|
184
225
|
strokeWidth: 1.3
|
|
185
|
-
}), /* @__PURE__ */
|
|
186
|
-
}), /* @__PURE__ */
|
|
226
|
+
}), /* @__PURE__ */ O("div", { className: "pointer-events-none absolute inset-0 bg-gradient-to-t from-black/25 to-transparent" })]
|
|
227
|
+
}), /* @__PURE__ */ k("div", {
|
|
187
228
|
className: "px-6 pb-6",
|
|
188
229
|
children: [
|
|
189
|
-
/* @__PURE__ */
|
|
230
|
+
/* @__PURE__ */ k("div", {
|
|
190
231
|
className: "-mt-10 flex flex-col gap-4 sm:flex-row sm:items-end",
|
|
191
|
-
children: [/* @__PURE__ */
|
|
232
|
+
children: [/* @__PURE__ */ k("div", {
|
|
192
233
|
className: "relative shrink-0",
|
|
193
|
-
children: [/* @__PURE__ */
|
|
194
|
-
className: n("flex h-20 w-20 items-center justify-center rounded-full bg-gradient-to-br text-white shadow-lg ring-4 ring-bg-surface", a(
|
|
195
|
-
children:
|
|
234
|
+
children: [/* @__PURE__ */ O("span", {
|
|
235
|
+
className: n("flex h-20 w-20 items-center justify-center rounded-full bg-gradient-to-br text-white shadow-lg ring-4 ring-bg-surface", a(x.headline)),
|
|
236
|
+
children: _(D, {
|
|
196
237
|
size: 34,
|
|
197
238
|
strokeWidth: 1.6
|
|
198
239
|
})
|
|
199
|
-
}),
|
|
200
|
-
}), /* @__PURE__ */
|
|
240
|
+
}), x.isAcceptingMentees ? /* @__PURE__ */ O("span", { className: "absolute bottom-1 right-1 h-4 w-4 rounded-full border-2 border-bg-surface bg-status-success-text" }) : null]
|
|
241
|
+
}), /* @__PURE__ */ k("div", {
|
|
201
242
|
className: "min-w-0 flex-1 sm:pb-1",
|
|
202
243
|
children: [
|
|
203
|
-
/* @__PURE__ */
|
|
244
|
+
/* @__PURE__ */ O("h1", {
|
|
204
245
|
className: "text-xl font-semibold text-text-primary sm:text-2xl",
|
|
205
|
-
children:
|
|
246
|
+
children: x.headline
|
|
206
247
|
}),
|
|
207
|
-
|
|
248
|
+
x.role ? /* @__PURE__ */ O("p", {
|
|
208
249
|
className: "mt-1 text-sm font-medium text-text-secondary",
|
|
209
|
-
children:
|
|
250
|
+
children: x.role
|
|
210
251
|
}) : null,
|
|
211
|
-
/* @__PURE__ */
|
|
252
|
+
/* @__PURE__ */ k("div", {
|
|
212
253
|
className: "mt-2 flex flex-wrap items-center gap-2",
|
|
213
|
-
children: [/* @__PURE__ */
|
|
254
|
+
children: [/* @__PURE__ */ O(u, { status: x.status }), x.isAcceptingMentees ? /* @__PURE__ */ k(A, {
|
|
214
255
|
variant: "outline",
|
|
215
256
|
className: "inline-flex items-center gap-1.5 border-status-success-border bg-status-success-bg-subtle text-status-success-text",
|
|
216
|
-
children: [/* @__PURE__ */
|
|
257
|
+
children: [/* @__PURE__ */ O("span", { className: "h-1.5 w-1.5 rounded-full bg-status-success-text" }), " Accepting mentees"]
|
|
217
258
|
}) : null]
|
|
218
259
|
})
|
|
219
260
|
]
|
|
220
261
|
})]
|
|
221
262
|
}),
|
|
222
|
-
|
|
263
|
+
x.bio ? /* @__PURE__ */ O("p", {
|
|
223
264
|
className: "mt-4 max-w-2xl text-sm leading-relaxed text-text-secondary",
|
|
224
|
-
children:
|
|
265
|
+
children: x.bio
|
|
225
266
|
}) : null,
|
|
226
|
-
|
|
267
|
+
x.expertise.length ? /* @__PURE__ */ O("div", {
|
|
227
268
|
className: "mt-4 flex flex-wrap gap-1.5",
|
|
228
|
-
children:
|
|
269
|
+
children: x.expertise.map((e) => /* @__PURE__ */ O(A, {
|
|
229
270
|
variant: "secondary",
|
|
230
271
|
children: e
|
|
231
272
|
}, e))
|
|
@@ -233,59 +274,59 @@ function F() {
|
|
|
233
274
|
]
|
|
234
275
|
})]
|
|
235
276
|
}),
|
|
236
|
-
/* @__PURE__ */
|
|
277
|
+
/* @__PURE__ */ k("div", {
|
|
237
278
|
className: "mb-6 grid grid-cols-2 gap-3 sm:grid-cols-4",
|
|
238
279
|
children: [
|
|
239
|
-
/* @__PURE__ */
|
|
280
|
+
/* @__PURE__ */ O(i, {
|
|
240
281
|
label: "Rate",
|
|
241
|
-
value: `${l(
|
|
242
|
-
icon:
|
|
282
|
+
value: `${l(x.hourlyRate, x.currency)}/hr`,
|
|
283
|
+
icon: S,
|
|
243
284
|
tone: "blue"
|
|
244
285
|
}),
|
|
245
|
-
/* @__PURE__ */
|
|
286
|
+
/* @__PURE__ */ O(i, {
|
|
246
287
|
label: "Rating",
|
|
247
|
-
value:
|
|
248
|
-
icon:
|
|
288
|
+
value: x.ratingAvg > 0 ? x.ratingAvg.toFixed(1) : "New",
|
|
289
|
+
icon: w,
|
|
249
290
|
tone: "amber"
|
|
250
291
|
}),
|
|
251
|
-
/* @__PURE__ */
|
|
292
|
+
/* @__PURE__ */ O(i, {
|
|
252
293
|
label: "Sessions",
|
|
253
|
-
value:
|
|
254
|
-
icon:
|
|
294
|
+
value: x.sessionsCount,
|
|
295
|
+
icon: C,
|
|
255
296
|
tone: "purple"
|
|
256
297
|
}),
|
|
257
|
-
/* @__PURE__ */
|
|
298
|
+
/* @__PURE__ */ O(i, {
|
|
258
299
|
label: "Status",
|
|
259
|
-
value:
|
|
260
|
-
icon:
|
|
300
|
+
value: x.status === "ACTIVE" ? "Active" : "Pending",
|
|
301
|
+
icon: y,
|
|
261
302
|
tone: "teal"
|
|
262
303
|
})
|
|
263
304
|
]
|
|
264
305
|
}),
|
|
265
|
-
/* @__PURE__ */
|
|
306
|
+
/* @__PURE__ */ k("div", {
|
|
266
307
|
className: "grid grid-cols-1 gap-6 lg:grid-cols-2",
|
|
267
|
-
children: [/* @__PURE__ */
|
|
268
|
-
mentorId:
|
|
269
|
-
disabled: !
|
|
270
|
-
onBooked: () => void
|
|
308
|
+
children: [/* @__PURE__ */ O(I, {
|
|
309
|
+
mentorId: x.id,
|
|
310
|
+
disabled: !x.isAcceptingMentees,
|
|
311
|
+
onBooked: () => void v(),
|
|
271
312
|
workspaceId: c
|
|
272
|
-
}), /* @__PURE__ */
|
|
313
|
+
}), /* @__PURE__ */ k(M, {
|
|
273
314
|
className: "p-5",
|
|
274
|
-
children: [/* @__PURE__ */
|
|
315
|
+
children: [/* @__PURE__ */ k("div", {
|
|
275
316
|
className: "mb-3 flex items-center gap-2",
|
|
276
|
-
children: [/* @__PURE__ */
|
|
317
|
+
children: [/* @__PURE__ */ O(b, {
|
|
277
318
|
size: 18,
|
|
278
319
|
className: "text-accent-teal"
|
|
279
|
-
}), /* @__PURE__ */
|
|
320
|
+
}), /* @__PURE__ */ O("h2", {
|
|
280
321
|
className: "text-base font-semibold text-text-primary",
|
|
281
322
|
children: "Recent sessions"
|
|
282
323
|
})]
|
|
283
|
-
}),
|
|
324
|
+
}), T.length === 0 ? /* @__PURE__ */ O("p", {
|
|
284
325
|
className: "py-6 text-center text-sm text-text-muted",
|
|
285
326
|
children: "No sessions booked yet. Be the first to request time with this mentor."
|
|
286
|
-
}) : /* @__PURE__ */
|
|
327
|
+
}) : /* @__PURE__ */ O("div", {
|
|
287
328
|
className: "divide-y divide-border-seam",
|
|
288
|
-
children:
|
|
329
|
+
children: T.map((e) => /* @__PURE__ */ O(L, { session: e }, e.id))
|
|
289
330
|
})]
|
|
290
331
|
})]
|
|
291
332
|
})
|
|
@@ -293,6 +334,6 @@ function F() {
|
|
|
293
334
|
});
|
|
294
335
|
}
|
|
295
336
|
//#endregion
|
|
296
|
-
export {
|
|
337
|
+
export { R as MentorshipMentorProfilePagePage };
|
|
297
338
|
|
|
298
339
|
//# sourceMappingURL=MentorshipMentorProfilePagePage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MentorshipMentorProfilePagePage.js","names":[],"sources":["../../../src/technospam/pages/MentorshipMentorProfilePagePage.tsx"],"sourcesContent":["import { createElement, useState } from 'react';\nimport { useSearchParams } from 'react-router-dom';\nimport { Award, CalendarClock, DollarSign, MessageSquare, Star, Video } from 'lucide-react';\nimport { Badge, Button, GlassCard, Input, Skeleton, Textarea } from '@burdenoff/fe-libs/ui';\nimport {\n EmptyView,\n ErrorView,\n PageLayout,\n StatCard,\n StatusBadge,\n coverGradient,\n topicIcon,\n} from '../components';\nimport { useTechnoSpam } from '../providers/TechnoSpamProvider';\nimport { useBookSession, useMentorQuery, type TecMentorSession } from '../api/technospamApi';\nimport { formatDateTime, formatDuration, formatMoney } from '../utils/format';\nimport { cn } from '../utils/cn';\nimport { notify } from '../lib/toast';\nimport { useTechnoSpamAnalytics } from '../hooks/useTechnoSpamAnalytics';\n\nfunction BookSessionForm({\n mentorId,\n disabled,\n onBooked,\n workspaceId,\n}: {\n mentorId: string;\n disabled: boolean;\n onBooked?: () => void;\n workspaceId?: string;\n}) {\n const [topic, setTopic] = useState('');\n const [agenda, setAgenda] = useState('');\n const [scheduledAt, setScheduledAt] = useState('');\n const [durationMinutes, setDurationMinutes] = useState('60');\n const [bookSession, { loading }] = useBookSession();\n const { emit } = useTechnoSpamAnalytics();\n\n const parsedDate = scheduledAt ? new Date(scheduledAt) : null;\n const validDate = parsedDate != null && !Number.isNaN(parsedDate.getTime());\n const canSubmit = topic.trim().length > 0 && validDate && !loading && !disabled;\n\n const handleSubmit = async () => {\n if (!canSubmit || !parsedDate) return;\n const input: {\n mentorId: string;\n topic: string;\n agenda?: string;\n scheduledAt: string;\n durationMinutes?: number;\n } = {\n mentorId,\n topic: topic.trim(),\n scheduledAt: parsedDate.toISOString(),\n };\n if (agenda.trim()) input.agenda = agenda.trim();\n const dur = Number.parseInt(durationMinutes, 10);\n if (!Number.isNaN(dur) && dur > 0) input.durationMinutes = dur;\n\n emit('technospam.mentor.book_clicked', {\n workspaceId,\n entityId: mentorId,\n entityType: 'TEC_MENTOR',\n });\n const res = await bookSession({ variables: { input } });\n if (res.data?.tecBookSession) {\n emit('technospam.mentor.booked', {\n workspaceId,\n entityId: mentorId,\n entityType: 'TEC_MENTOR',\n sessionId: res.data.tecBookSession.id,\n });\n notify.success('Session requested', 'Your mentor will confirm the booking soon.');\n setTopic('');\n setAgenda('');\n setScheduledAt('');\n setDurationMinutes('60');\n onBooked?.();\n }\n };\n\n return (\n <GlassCard className=\"p-5\">\n <div className=\"mb-4 flex items-start gap-3\">\n <span className=\"flex h-11 w-11 shrink-0 items-center justify-center rounded-xl bg-gradient-to-br from-accent-primary to-accent-purple text-white shadow-sm\">\n <CalendarClock size={20} />\n </span>\n <div>\n <h2 className=\"text-base font-semibold text-text-primary\">Book a session</h2>\n <p className=\"text-sm text-text-secondary\">Schedule 1:1 time with your mentor.</p>\n </div>\n </div>\n\n {disabled ? (\n <p className=\"rounded-lg border border-border-seam bg-bg-sunken px-3 py-2 text-sm text-text-secondary\">\n This mentor isn't accepting new mentees right now.\n </p>\n ) : null}\n\n <div className=\"mt-4 grid grid-cols-1 gap-4\">\n <div>\n <label className=\"mb-1.5 block text-sm font-medium text-text-primary\">\n Topic <span className=\"text-status-error-text\">*</span>\n </label>\n <Input\n placeholder=\"e.g. System design interview prep\"\n value={topic}\n onChange={(e) => setTopic(e.target.value)}\n disabled={disabled}\n />\n </div>\n\n <div>\n <label className=\"mb-1.5 block text-sm font-medium text-text-primary\">Agenda</label>\n <Textarea\n rows={3}\n placeholder=\"What would you like to cover? Share context so your mentor can prepare.\"\n value={agenda}\n onChange={(e) => setAgenda(e.target.value)}\n disabled={disabled}\n />\n </div>\n\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2\">\n <div>\n <label className=\"mb-1.5 block text-sm font-medium text-text-primary\">\n When <span className=\"text-status-error-text\">*</span>\n </label>\n <Input\n type=\"datetime-local\"\n value={scheduledAt}\n onChange={(e) => setScheduledAt(e.target.value)}\n disabled={disabled}\n />\n </div>\n <div>\n <label className=\"mb-1.5 block text-sm font-medium text-text-primary\">\n Duration (min)\n </label>\n <Input\n type=\"number\"\n min={15}\n step={15}\n value={durationMinutes}\n onChange={(e) => setDurationMinutes(e.target.value)}\n disabled={disabled}\n />\n </div>\n </div>\n\n <Button\n className=\"w-full bg-gradient-to-r from-accent-primary to-accent-purple\"\n onClick={handleSubmit}\n disabled={!canSubmit}\n >\n <CalendarClock size={16} /> {loading ? 'Requesting…' : 'Request session'}\n </Button>\n </div>\n </GlassCard>\n );\n}\n\nfunction SessionSummaryRow({ session }: { session: TecMentorSession }) {\n return (\n <div className=\"flex items-center gap-3 rounded-lg px-1 py-3 transition-colors hover:bg-bg-sunken\">\n <span className=\"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-accent-purple/12 text-accent-purple\">\n <Video size={16} />\n </span>\n <div className=\"min-w-0 flex-1\">\n <div className=\"truncate text-sm font-medium text-text-primary\">{session.topic}</div>\n <div className=\"text-xs text-text-muted\">\n {formatDateTime(session.scheduledAt)} · {formatDuration(session.durationMinutes)}\n </div>\n </div>\n <StatusBadge status={session.status} />\n </div>\n );\n}\n\nexport function MentorshipMentorProfilePagePage() {\n const [params] = useSearchParams();\n const id = params.get('id') ?? '';\n const { workspaceId } = useTechnoSpam();\n const { data, loading, error, refetch } = useMentorQuery(id);\n\n const mentor = data?.tecMentor ?? null;\n\n if (loading && !mentor) {\n return (\n <PageLayout title=\"Mentor\" backPath=\"/mentorship/mentors-page\">\n <Skeleton className=\"mb-4 h-40 w-full rounded-xl\" />\n <Skeleton className=\"h-64 w-full rounded-xl\" />\n </PageLayout>\n );\n }\n\n if (error || !mentor) {\n return (\n <PageLayout title=\"Mentor\" backPath=\"/mentorship/mentors-page\">\n {error ? (\n <ErrorView title=\"Couldn't load mentor\" error={error} />\n ) : (\n <EmptyView\n title=\"Mentor not found\"\n description=\"This mentor profile may no longer be available.\"\n />\n )}\n </PageLayout>\n );\n }\n\n const sessions = mentor.sessions ?? [];\n const recentSessions = [...sessions]\n .sort((a, b) => new Date(b.scheduledAt).getTime() - new Date(a.scheduledAt).getTime())\n .slice(0, 5);\n\n const HeroIcon = topicIcon(mentor.expertise.join(' ') || mentor.headline);\n\n return (\n <PageLayout hero backPath=\"/mentorship/mentors-page\" title=\"Mentor Profile\">\n <GlassCard className=\"mb-6 overflow-hidden p-0\">\n <div\n className={cn(\n 'relative h-24 overflow-hidden bg-gradient-to-br',\n coverGradient(mentor.headline)\n )}\n >\n {createElement(HeroIcon, {\n className: 'pointer-events-none absolute -right-3 -top-4 text-white/15',\n size: 120,\n strokeWidth: 1.3,\n })}\n <div className=\"pointer-events-none absolute inset-0 bg-gradient-to-t from-black/25 to-transparent\" />\n </div>\n <div className=\"px-6 pb-6\">\n <div className=\"-mt-10 flex flex-col gap-4 sm:flex-row sm:items-end\">\n <div className=\"relative shrink-0\">\n <span\n className={cn(\n 'flex h-20 w-20 items-center justify-center rounded-full bg-gradient-to-br text-white shadow-lg ring-4 ring-bg-surface',\n coverGradient(mentor.headline)\n )}\n >\n {createElement(HeroIcon, { size: 34, strokeWidth: 1.6 })}\n </span>\n {mentor.isAcceptingMentees ? (\n <span className=\"absolute bottom-1 right-1 h-4 w-4 rounded-full border-2 border-bg-surface bg-status-success-text\" />\n ) : null}\n </div>\n <div className=\"min-w-0 flex-1 sm:pb-1\">\n <h1 className=\"text-xl font-semibold text-text-primary sm:text-2xl\">\n {mentor.headline}\n </h1>\n {mentor.role ? (\n <p className=\"mt-1 text-sm font-medium text-text-secondary\">{mentor.role}</p>\n ) : null}\n <div className=\"mt-2 flex flex-wrap items-center gap-2\">\n <StatusBadge status={mentor.status} />\n {mentor.isAcceptingMentees ? (\n <Badge\n variant=\"outline\"\n className=\"inline-flex items-center gap-1.5 border-status-success-border bg-status-success-bg-subtle text-status-success-text\"\n >\n <span className=\"h-1.5 w-1.5 rounded-full bg-status-success-text\" /> Accepting\n mentees\n </Badge>\n ) : null}\n </div>\n </div>\n </div>\n\n {mentor.bio ? (\n <p className=\"mt-4 max-w-2xl text-sm leading-relaxed text-text-secondary\">\n {mentor.bio}\n </p>\n ) : null}\n\n {mentor.expertise.length ? (\n <div className=\"mt-4 flex flex-wrap gap-1.5\">\n {mentor.expertise.map((skill) => (\n <Badge key={skill} variant=\"secondary\">\n {skill}\n </Badge>\n ))}\n </div>\n ) : null}\n </div>\n </GlassCard>\n\n <div className=\"mb-6 grid grid-cols-2 gap-3 sm:grid-cols-4\">\n <StatCard\n label=\"Rate\"\n value={`${formatMoney(mentor.hourlyRate, mentor.currency)}/hr`}\n icon={DollarSign}\n tone=\"blue\"\n />\n <StatCard\n label=\"Rating\"\n value={mentor.ratingAvg > 0 ? mentor.ratingAvg.toFixed(1) : 'New'}\n icon={Star}\n tone=\"amber\"\n />\n <StatCard\n label=\"Sessions\"\n value={mentor.sessionsCount}\n icon={MessageSquare}\n tone=\"purple\"\n />\n <StatCard\n label=\"Status\"\n value={mentor.status === 'ACTIVE' ? 'Active' : 'Pending'}\n icon={Award}\n tone=\"teal\"\n />\n </div>\n\n <div className=\"grid grid-cols-1 gap-6 lg:grid-cols-2\">\n <BookSessionForm\n mentorId={mentor.id}\n disabled={!mentor.isAcceptingMentees}\n onBooked={() => void refetch()}\n workspaceId={workspaceId}\n />\n\n <GlassCard className=\"p-5\">\n <div className=\"mb-3 flex items-center gap-2\">\n <CalendarClock size={18} className=\"text-accent-teal\" />\n <h2 className=\"text-base font-semibold text-text-primary\">Recent sessions</h2>\n </div>\n {recentSessions.length === 0 ? (\n <p className=\"py-6 text-center text-sm text-text-muted\">\n No sessions booked yet. Be the first to request time with this mentor.\n </p>\n ) : (\n <div className=\"divide-y divide-border-seam\">\n {recentSessions.map((session) => (\n <SessionSummaryRow key={session.id} session={session} />\n ))}\n </div>\n )}\n </GlassCard>\n </div>\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAoBA,SAAS,EAAgB,EACvB,aACA,aACA,aACA,kBAMC;CACD,IAAM,CAAC,GAAO,KAAY,EAAS,GAAG,EAChC,CAAC,GAAQ,KAAa,EAAS,GAAG,EAClC,CAAC,GAAa,KAAkB,EAAS,GAAG,EAC5C,CAAC,GAAiB,KAAsB,EAAS,KAAK,EACtD,CAAC,GAAa,EAAE,gBAAa,GAAgB,EAC7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O,GAAG,EAAY,EAAO,YAAY,EAAO,SAAS,CAAC;MAC1D,MAAM;MACN,MAAK;MACL,CAAA;KACF,kBAAC,GAAD;MACE,OAAM;MACN,OAAO,EAAO,YAAY,IAAI,EAAO,UAAU,QAAQ,EAAE,GAAG;MAC5D,MAAM;MACN,MAAK;MACL,CAAA;KACF,kBAAC,GAAD;MACE,OAAM;MACN,OAAO,EAAO;MACd,MAAM;MACN,MAAK;MACL,CAAA;KACF,kBAAC,GAAD;MACE,OAAM;MACN,OAAO,EAAO,WAAW,WAAW,WAAW;MAC/C,MAAM;MACN,MAAK;MACL,CAAA;KACE;;GAEN,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,GAAD;KACE,UAAU,EAAO;KACjB,UAAU,CAAC,EAAO;KAClB,gBAAgB,KAAK,GAAS;KACjB;KACb,CAAA,EAEF,kBAAC,GAAD;KAAW,WAAU;eAArB,CACE,kBAAC,OAAD;MAAK,WAAU;gBAAf,CACE,kBAAC,GAAD;OAAe,MAAM;OAAI,WAAU;OAAqB,CAAA,EACxD,kBAAC,MAAD;OAAI,WAAU;iBAA4C;OAAoB,CAAA,CAC1E;SACL,EAAe,WAAW,IACzB,kBAAC,KAAD;MAAG,WAAU;gBAA2C;MAEpD,CAAA,GAEJ,kBAAC,OAAD;MAAK,WAAU;gBACZ,EAAe,KAAK,MACnB,kBAAC,GAAD,EAA6C,YAAW,EAAhC,EAAQ,GAAwB,CACxD;MACE,CAAA,CAEE;OACR;;GACK"}
|
|
1
|
+
{"version":3,"file":"MentorshipMentorProfilePagePage.js","names":[],"sources":["../../../src/technospam/pages/MentorshipMentorProfilePagePage.tsx"],"sourcesContent":["import { createElement, useState } from 'react';\nimport { useSearchParams } from 'react-router-dom';\nimport {\n Award,\n CalendarClock,\n CreditCard,\n DollarSign,\n MessageSquare,\n Star,\n Video,\n} from 'lucide-react';\nimport { Badge, Button, GlassCard, Input, Skeleton, Textarea } from '@burdenoff/fe-libs/ui';\nimport {\n EmptyView,\n ErrorView,\n PageLayout,\n StatCard,\n StatusBadge,\n coverGradient,\n topicIcon,\n} from '../components';\nimport { useTechnoSpam } from '../providers/TechnoSpamProvider';\nimport {\n useBookSession,\n useMentorQuery,\n useSessionCostEstimate,\n type TecMentorSession,\n} from '../api/technospamApi';\nimport { formatDateTime, formatDuration, formatMoneyFromMinorUnits } from '../utils/format';\nimport { cn } from '../utils/cn';\nimport { notify } from '../lib/toast';\nimport { useTechnoSpamAnalytics } from '../hooks/useTechnoSpamAnalytics';\n\nfunction BookSessionForm({\n mentorId,\n disabled,\n onBooked,\n workspaceId,\n}: {\n mentorId: string;\n disabled: boolean;\n onBooked?: () => void;\n workspaceId?: string;\n}) {\n const [topic, setTopic] = useState('');\n const [agenda, setAgenda] = useState('');\n const [scheduledAt, setScheduledAt] = useState('');\n const [durationMinutes, setDurationMinutes] = useState('60');\n const [bookSession, { loading }] = useBookSession();\n const { emit } = useTechnoSpamAnalytics();\n\n const parsedDate = scheduledAt ? new Date(scheduledAt) : null;\n const validDate = parsedDate != null && !Number.isNaN(parsedDate.getTime());\n const canSubmit = topic.trim().length > 0 && validDate && !loading && !disabled;\n\n // Live cost preview -- computed server-side from the mentor's real rate,\n // the exact same calculation tecBookSession snapshots onto the session.\n // Shown BEFORE booking so the mentee sees the real price up front.\n const parsedDuration = Number.parseInt(durationMinutes, 10);\n const { data: costData, loading: costLoading } = useSessionCostEstimate(\n mentorId,\n Number.isNaN(parsedDuration) ? 0 : parsedDuration\n );\n const estimate = costData?.tecCalculateSessionCost;\n\n const handleSubmit = async () => {\n if (!canSubmit || !parsedDate) return;\n const input: {\n mentorId: string;\n topic: string;\n agenda?: string;\n scheduledAt: string;\n durationMinutes?: number;\n } = {\n mentorId,\n topic: topic.trim(),\n scheduledAt: parsedDate.toISOString(),\n };\n if (agenda.trim()) input.agenda = agenda.trim();\n const dur = Number.parseInt(durationMinutes, 10);\n if (!Number.isNaN(dur) && dur > 0) input.durationMinutes = dur;\n\n emit('technospam.mentor.book_clicked', {\n workspaceId,\n entityId: mentorId,\n entityType: 'TEC_MENTOR',\n });\n const res = await bookSession({ variables: { input } });\n if (res.data?.tecBookSession) {\n emit('technospam.mentor.booked', {\n workspaceId,\n entityId: mentorId,\n entityType: 'TEC_MENTOR',\n sessionId: res.data.tecBookSession.id,\n });\n notify.success('Session requested', 'Your mentor will confirm the booking soon.');\n setTopic('');\n setAgenda('');\n setScheduledAt('');\n setDurationMinutes('60');\n onBooked?.();\n }\n };\n\n return (\n <GlassCard className=\"p-5\">\n <div className=\"mb-4 flex items-start gap-3\">\n <span className=\"flex h-11 w-11 shrink-0 items-center justify-center rounded-xl bg-gradient-to-br from-accent-primary to-accent-purple text-white shadow-sm\">\n <CalendarClock size={20} />\n </span>\n <div>\n <h2 className=\"text-base font-semibold text-text-primary\">Book a session</h2>\n <p className=\"text-sm text-text-secondary\">Schedule 1:1 time with your mentor.</p>\n </div>\n </div>\n\n {disabled ? (\n <p className=\"rounded-lg border border-border-seam bg-bg-sunken px-3 py-2 text-sm text-text-secondary\">\n This mentor isn't accepting new mentees right now.\n </p>\n ) : null}\n\n <div className=\"mt-4 grid grid-cols-1 gap-4\">\n <div>\n <label className=\"mb-1.5 block text-sm font-medium text-text-primary\">\n Topic <span className=\"text-status-error-text\">*</span>\n </label>\n <Input\n placeholder=\"e.g. System design interview prep\"\n value={topic}\n onChange={(e) => setTopic(e.target.value)}\n disabled={disabled}\n />\n </div>\n\n <div>\n <label className=\"mb-1.5 block text-sm font-medium text-text-primary\">Agenda</label>\n <Textarea\n rows={3}\n placeholder=\"What would you like to cover? Share context so your mentor can prepare.\"\n value={agenda}\n onChange={(e) => setAgenda(e.target.value)}\n disabled={disabled}\n />\n </div>\n\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2\">\n <div>\n <label className=\"mb-1.5 block text-sm font-medium text-text-primary\">\n When <span className=\"text-status-error-text\">*</span>\n </label>\n <Input\n type=\"datetime-local\"\n value={scheduledAt}\n onChange={(e) => setScheduledAt(e.target.value)}\n disabled={disabled}\n />\n </div>\n <div>\n <label className=\"mb-1.5 block text-sm font-medium text-text-primary\">\n Duration (min)\n </label>\n <Input\n type=\"number\"\n min={15}\n step={15}\n value={durationMinutes}\n onChange={(e) => setDurationMinutes(e.target.value)}\n disabled={disabled}\n />\n </div>\n </div>\n\n <div className=\"rounded-lg border border-border-seam bg-bg-sunken px-3 py-2.5\">\n {costLoading && !estimate ? (\n <Skeleton className=\"h-5 w-40 rounded\" />\n ) : estimate ? (\n <>\n <div className=\"flex items-center justify-between text-sm\">\n <span className=\"text-text-secondary\">Session cost</span>\n <span className=\"font-semibold text-text-primary\">\n {formatMoneyFromMinorUnits(estimate.costAmount, estimate.currency)}\n </span>\n </div>\n <p className=\"mt-0.5 text-xs text-text-muted\">\n Includes a {(estimate.platformFeeBps / 100).toFixed(0)}% platform fee (\n {formatMoneyFromMinorUnits(estimate.platformFeeAmount, estimate.currency)}) — the mentor keeps{' '}\n {formatMoneyFromMinorUnits(estimate.netAmount, estimate.currency)}.\n </p>\n </>\n ) : (\n <p className=\"text-sm text-text-muted\">Enter a duration to preview the session cost.</p>\n )}\n </div>\n\n <Button\n className=\"w-full bg-gradient-to-r from-accent-primary to-accent-purple\"\n onClick={handleSubmit}\n disabled={!canSubmit}\n >\n <CalendarClock size={16} /> {loading ? 'Requesting…' : 'Request session'}\n </Button>\n\n <div className=\"flex items-center justify-between gap-2 rounded-lg border border-border-seam px-3 py-2\">\n <span className=\"flex items-center gap-1.5 text-xs text-text-muted\">\n <CreditCard size={14} /> Payment integration pending\n </span>\n <Button\n variant=\"outline\"\n size=\"sm\"\n disabled\n title=\"Online payment collection is not live yet\"\n >\n Pay now\n </Button>\n </div>\n </div>\n </GlassCard>\n );\n}\n\nfunction SessionSummaryRow({ session }: { session: TecMentorSession }) {\n return (\n <div className=\"flex items-center gap-3 rounded-lg px-1 py-3 transition-colors hover:bg-bg-sunken\">\n <span className=\"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-accent-purple/12 text-accent-purple\">\n <Video size={16} />\n </span>\n <div className=\"min-w-0 flex-1\">\n <div className=\"truncate text-sm font-medium text-text-primary\">{session.topic}</div>\n <div className=\"text-xs text-text-muted\">\n {formatDateTime(session.scheduledAt)} · {formatDuration(session.durationMinutes)}\n </div>\n </div>\n <StatusBadge status={session.status} />\n </div>\n );\n}\n\nexport function MentorshipMentorProfilePagePage() {\n const [params] = useSearchParams();\n const id = params.get('id') ?? '';\n const { workspaceId } = useTechnoSpam();\n const { data, loading, error, refetch } = useMentorQuery(id);\n\n const mentor = data?.tecMentor ?? null;\n\n if (loading && !mentor) {\n return (\n <PageLayout title=\"Mentor\" backPath=\"/mentorship/mentors-page\">\n <Skeleton className=\"mb-4 h-40 w-full rounded-xl\" />\n <Skeleton className=\"h-64 w-full rounded-xl\" />\n </PageLayout>\n );\n }\n\n if (error || !mentor) {\n return (\n <PageLayout title=\"Mentor\" backPath=\"/mentorship/mentors-page\">\n {error ? (\n <ErrorView title=\"Couldn't load mentor\" error={error} />\n ) : (\n <EmptyView\n title=\"Mentor not found\"\n description=\"This mentor profile may no longer be available.\"\n />\n )}\n </PageLayout>\n );\n }\n\n const sessions = mentor.sessions ?? [];\n const recentSessions = [...sessions]\n .sort((a, b) => new Date(b.scheduledAt).getTime() - new Date(a.scheduledAt).getTime())\n .slice(0, 5);\n\n const HeroIcon = topicIcon(mentor.expertise.join(' ') || mentor.headline);\n\n return (\n <PageLayout hero backPath=\"/mentorship/mentors-page\" title=\"Mentor Profile\">\n <GlassCard className=\"mb-6 overflow-hidden p-0\">\n <div\n className={cn(\n 'relative h-24 overflow-hidden bg-gradient-to-br',\n coverGradient(mentor.headline)\n )}\n >\n {createElement(HeroIcon, {\n className: 'pointer-events-none absolute -right-3 -top-4 text-white/15',\n size: 120,\n strokeWidth: 1.3,\n })}\n <div className=\"pointer-events-none absolute inset-0 bg-gradient-to-t from-black/25 to-transparent\" />\n </div>\n <div className=\"px-6 pb-6\">\n <div className=\"-mt-10 flex flex-col gap-4 sm:flex-row sm:items-end\">\n <div className=\"relative shrink-0\">\n <span\n className={cn(\n 'flex h-20 w-20 items-center justify-center rounded-full bg-gradient-to-br text-white shadow-lg ring-4 ring-bg-surface',\n coverGradient(mentor.headline)\n )}\n >\n {createElement(HeroIcon, { size: 34, strokeWidth: 1.6 })}\n </span>\n {mentor.isAcceptingMentees ? (\n <span className=\"absolute bottom-1 right-1 h-4 w-4 rounded-full border-2 border-bg-surface bg-status-success-text\" />\n ) : null}\n </div>\n <div className=\"min-w-0 flex-1 sm:pb-1\">\n <h1 className=\"text-xl font-semibold text-text-primary sm:text-2xl\">\n {mentor.headline}\n </h1>\n {mentor.role ? (\n <p className=\"mt-1 text-sm font-medium text-text-secondary\">{mentor.role}</p>\n ) : null}\n <div className=\"mt-2 flex flex-wrap items-center gap-2\">\n <StatusBadge status={mentor.status} />\n {mentor.isAcceptingMentees ? (\n <Badge\n variant=\"outline\"\n className=\"inline-flex items-center gap-1.5 border-status-success-border bg-status-success-bg-subtle text-status-success-text\"\n >\n <span className=\"h-1.5 w-1.5 rounded-full bg-status-success-text\" /> Accepting\n mentees\n </Badge>\n ) : null}\n </div>\n </div>\n </div>\n\n {mentor.bio ? (\n <p className=\"mt-4 max-w-2xl text-sm leading-relaxed text-text-secondary\">\n {mentor.bio}\n </p>\n ) : null}\n\n {mentor.expertise.length ? (\n <div className=\"mt-4 flex flex-wrap gap-1.5\">\n {mentor.expertise.map((skill) => (\n <Badge key={skill} variant=\"secondary\">\n {skill}\n </Badge>\n ))}\n </div>\n ) : null}\n </div>\n </GlassCard>\n\n <div className=\"mb-6 grid grid-cols-2 gap-3 sm:grid-cols-4\">\n <StatCard\n label=\"Rate\"\n value={`${formatMoneyFromMinorUnits(mentor.hourlyRate, mentor.currency)}/hr`}\n icon={DollarSign}\n tone=\"blue\"\n />\n <StatCard\n label=\"Rating\"\n value={mentor.ratingAvg > 0 ? mentor.ratingAvg.toFixed(1) : 'New'}\n icon={Star}\n tone=\"amber\"\n />\n <StatCard\n label=\"Sessions\"\n value={mentor.sessionsCount}\n icon={MessageSquare}\n tone=\"purple\"\n />\n <StatCard\n label=\"Status\"\n value={mentor.status === 'ACTIVE' ? 'Active' : 'Pending'}\n icon={Award}\n tone=\"teal\"\n />\n </div>\n\n <div className=\"grid grid-cols-1 gap-6 lg:grid-cols-2\">\n <BookSessionForm\n mentorId={mentor.id}\n disabled={!mentor.isAcceptingMentees}\n onBooked={() => void refetch()}\n workspaceId={workspaceId}\n />\n\n <GlassCard className=\"p-5\">\n <div className=\"mb-3 flex items-center gap-2\">\n <CalendarClock size={18} className=\"text-accent-teal\" />\n <h2 className=\"text-base font-semibold text-text-primary\">Recent sessions</h2>\n </div>\n {recentSessions.length === 0 ? (\n <p className=\"py-6 text-center text-sm text-text-muted\">\n No sessions booked yet. Be the first to request time with this mentor.\n </p>\n ) : (\n <div className=\"divide-y divide-border-seam\">\n {recentSessions.map((session) => (\n <SessionSummaryRow key={session.id} session={session} />\n ))}\n </div>\n )}\n </GlassCard>\n </div>\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAiCA,SAAS,EAAgB,EACvB,aACA,aACA,aACA,kBAMC;CACD,IAAM,CAAC,GAAO,KAAY,EAAS,GAAG,EAChC,CAAC,GAAQ,KAAa,EAAS,GAAG,EAClC,CAAC,GAAa,KAAkB,EAAS,GAAG,EAC5C,CAAC,GAAiB,KAAsB,EAAS,KAAK,EACtD,CAAC,GAAa,EAAE,gBAAa,GAAgB,EAC7C,EAAE,YAAS,GAAwB,EAEnC,IAAa,IAAc,IAAI,KAAK,EAAY,GAAG,MACnD,IAAY,KAAc,QAAQ,CAAC,OAAO,MAAM,EAAW,SAAS,CAAC,EACrE,IAAY,EAAM,MAAM,CAAC,SAAS,KAAK,KAAa,CAAC,KAAW,CAAC,GAKjE,IAAiB,OAAO,SAAS,GAAiB,GAAG,EACrD,EAAE,MAAM,GAAU,SAAS,MAAgB,EAC/C,GACA,OAAO,MAAM,E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AK,WAAU;gBAAf,CACE,kBAAC,GAAD;OAAe,MAAM;OAAI,WAAU;OAAqB,CAAA,EACxD,kBAAC,MAAD;OAAI,WAAU;iBAA4C;OAAoB,CAAA,CAC1E;SACL,EAAe,WAAW,IACzB,kBAAC,KAAD;MAAG,WAAU;gBAA2C;MAEpD,CAAA,GAEJ,kBAAC,OAAD;MAAK,WAAU;gBACZ,EAAe,KAAK,MACnB,kBAAC,GAAD,EAA6C,YAAW,EAAhC,EAAQ,GAAwB,CACxD;MACE,CAAA,CAEE;OACR;;GACK"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MentorshipMentorsPagePage.d.ts","sourceRoot":"","sources":["../../../src/technospam/pages/MentorshipMentorsPagePage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MentorshipMentorsPagePage.d.ts","sourceRoot":"","sources":["../../../src/technospam/pages/MentorshipMentorsPagePage.tsx"],"names":[],"mappings":"AA4SA,wBAAgB,yBAAyB,gCAwIxC"}
|
|
@@ -4,7 +4,7 @@ import { cn as r } from "../utils/cn.js";
|
|
|
4
4
|
import { PageLayout as i } from "../components/PageLayout.js";
|
|
5
5
|
import { StatCard as a } from "../components/StatCard.js";
|
|
6
6
|
import { coverGradient as o, topicIcon as s } from "../components/MediaCover.js";
|
|
7
|
-
import {
|
|
7
|
+
import { formatMoneyFromMinorUnits as c } from "../utils/format.js";
|
|
8
8
|
import { LoadMore as l } from "../components/LoadMore.js";
|
|
9
9
|
import { EmptyView as u, ErrorView as d, LoadingGrid as f } from "../components/StateViews.js";
|
|
10
10
|
import "../components/index.js";
|
|
@@ -208,13 +208,14 @@ function R({ onClose: e, onDone: t, workspaceId: r }) {
|
|
|
208
208
|
/* @__PURE__ */ k(P, {
|
|
209
209
|
type: "number",
|
|
210
210
|
min: 0,
|
|
211
|
-
|
|
211
|
+
step: .01,
|
|
212
|
+
placeholder: "0.00",
|
|
212
213
|
value: f,
|
|
213
214
|
onChange: (e) => m(e.target.value)
|
|
214
215
|
}),
|
|
215
216
|
/* @__PURE__ */ k("p", {
|
|
216
217
|
className: "mt-1 text-xs text-text-muted",
|
|
217
|
-
children: "
|
|
218
|
+
children: "Dollars per hour (e.g. 50 or 49.99). Leave 0 for free."
|
|
218
219
|
})
|
|
219
220
|
] }), /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("label", {
|
|
220
221
|
className: "mb-1.5 block text-sm font-medium text-text-primary",
|
|
@@ -234,8 +235,8 @@ function R({ onClose: e, onDone: t, workspaceId: r }) {
|
|
|
234
235
|
o.trim() && (e.role = o.trim()), c.trim() && (e.bio = c.trim());
|
|
235
236
|
let n = u.split(",").map((e) => e.trim()).filter(Boolean);
|
|
236
237
|
n.length && (e.expertise = n);
|
|
237
|
-
let a = Number.
|
|
238
|
-
!Number.isNaN(a) && a >= 0 && (e.hourlyRate = a), g.trim() && (e.currency = g.trim().toUpperCase()), x("technospam.mentor.become_mentor_clicked", { workspaceId: r });
|
|
238
|
+
let a = Number.parseFloat(f);
|
|
239
|
+
!Number.isNaN(a) && a >= 0 && (e.hourlyRate = Math.round(a * 100)), g.trim() && (e.currency = g.trim().toUpperCase()), x("technospam.mentor.become_mentor_clicked", { workspaceId: r });
|
|
239
240
|
let s = await v({ variables: { input: e } });
|
|
240
241
|
s.data?.tecBecomeMentor && (x("technospam.mentor.became_mentor", {
|
|
241
242
|
workspaceId: r,
|