@burdenoff/microfe-healthybowl 2026.802.2 → 2026.803.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/healthybowl/hooks/useReportsApi.js +26 -63
- package/dist/healthybowl/hooks/useReportsApi.js.map +1 -1
- package/dist/healthybowl/pages/network/ExpertsPage.js +9 -16
- package/dist/healthybowl/pages/network/ExpertsPage.js.map +1 -1
- package/dist/healthybowl/pages/reports-api/ReportsApiPage.js +152 -384
- package/dist/healthybowl/pages/reports-api/ReportsApiPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -9,45 +9,26 @@ var a = [{
|
|
|
9
9
|
}, {
|
|
10
10
|
value: "healthybowl.order.paid",
|
|
11
11
|
label: "Order paid (order.paid)"
|
|
12
|
-
}], o = "\n id\n name\n
|
|
13
|
-
query HealthyBowlApiKeys {
|
|
14
|
-
apiKeys {
|
|
15
|
-
${o}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
`, l = n`
|
|
19
|
-
mutation HealthyBowlCreateApiKey($input: CreateApiKeyInput!) {
|
|
20
|
-
createApiKey(input: $input) {
|
|
21
|
-
${o}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
`, u = n`
|
|
25
|
-
mutation HealthyBowlRevokeApiKey($id: ID!) {
|
|
26
|
-
revokeApiKey(id: $id) {
|
|
27
|
-
id
|
|
28
|
-
isActive
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
`, d = n`
|
|
12
|
+
}], o = "\n id\n name\n url\n events\n isActive\n lastDelivery\n lastError\n deliveryCount\n failureCount\n createdAt\n", s = n`
|
|
32
13
|
query HealthyBowlWebhooks {
|
|
33
14
|
webhooks {
|
|
34
15
|
items {
|
|
35
|
-
${
|
|
16
|
+
${o}
|
|
36
17
|
}
|
|
37
18
|
total
|
|
38
19
|
}
|
|
39
20
|
}
|
|
40
|
-
`,
|
|
21
|
+
`, c = n`
|
|
41
22
|
mutation HealthyBowlCreateWebhook($input: CreateWebhookInput!) {
|
|
42
23
|
createWebhook(input: $input) {
|
|
43
|
-
${
|
|
24
|
+
${o}
|
|
44
25
|
}
|
|
45
26
|
}
|
|
46
|
-
`,
|
|
27
|
+
`, l = n`
|
|
47
28
|
mutation HealthyBowlDeleteWebhook($id: ID!) {
|
|
48
29
|
deleteWebhook(id: $id)
|
|
49
30
|
}
|
|
50
|
-
`,
|
|
31
|
+
`, u = n`
|
|
51
32
|
query HealthyBowlBigConsoleDashboards($first: Int) {
|
|
52
33
|
listDashboards(first: $first) {
|
|
53
34
|
totalCount
|
|
@@ -62,60 +43,42 @@ var a = [{
|
|
|
62
43
|
}
|
|
63
44
|
}
|
|
64
45
|
`;
|
|
65
|
-
function
|
|
66
|
-
let { workspaceId: n } = e(), a = { workspaceId: n }, o = i(
|
|
67
|
-
skip: !n,
|
|
68
|
-
fetchPolicy: "cache-and-network",
|
|
69
|
-
notifyOnNetworkStatusChange: !0,
|
|
70
|
-
errorPolicy: "all"
|
|
71
|
-
}), s = i(d, {
|
|
46
|
+
function d() {
|
|
47
|
+
let { workspaceId: n } = e(), a = { workspaceId: n }, o = i(s, {
|
|
72
48
|
skip: !n,
|
|
73
49
|
fetchPolicy: "cache-and-network",
|
|
74
50
|
notifyOnNetworkStatusChange: !0,
|
|
75
51
|
errorPolicy: "all"
|
|
76
|
-
}),
|
|
52
|
+
}), d = i(u, {
|
|
77
53
|
variables: { first: 50 },
|
|
78
54
|
skip: !n,
|
|
79
55
|
fetchPolicy: "cache-and-network",
|
|
80
56
|
notifyOnNetworkStatusChange: !0,
|
|
81
57
|
errorPolicy: "all"
|
|
82
|
-
}), [
|
|
83
|
-
|
|
84
|
-
name: e,
|
|
85
|
-
permissions: t
|
|
86
|
-
} } });
|
|
87
|
-
return await o.refetch(), n.data?.createApiKey ?? null;
|
|
88
|
-
}, [g, o]), x = t(async (e) => {
|
|
89
|
-
await _({ variables: { id: e } }), await o.refetch();
|
|
90
|
-
}, [_, o]), S = t(async (e) => {
|
|
91
|
-
await v({ variables: { input: {
|
|
58
|
+
}), [f] = r(c), [p] = r(l), m = t(async (e) => {
|
|
59
|
+
await f({ variables: { input: {
|
|
92
60
|
...e,
|
|
93
61
|
context: a
|
|
94
|
-
} } }), await
|
|
62
|
+
} } }), await o.refetch();
|
|
95
63
|
}, [
|
|
96
|
-
|
|
97
|
-
|
|
64
|
+
f,
|
|
65
|
+
o,
|
|
98
66
|
n
|
|
99
|
-
]),
|
|
100
|
-
await
|
|
101
|
-
}, [
|
|
67
|
+
]), h = t(async (e) => {
|
|
68
|
+
await p({ variables: { id: e } }), await o.refetch();
|
|
69
|
+
}, [p, o]);
|
|
102
70
|
return {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
createWebhook: S,
|
|
112
|
-
deleteWebhook: C,
|
|
113
|
-
dashboards: (h.data?.listDashboards?.edges ?? []).map((e) => e.node),
|
|
114
|
-
dashboardsLoading: h.loading,
|
|
115
|
-
dashboardsError: h.error?.message ?? null
|
|
71
|
+
webhooks: o.data?.webhooks?.items ?? [],
|
|
72
|
+
webhooksLoading: o.loading,
|
|
73
|
+
webhooksError: o.error?.message ?? null,
|
|
74
|
+
createWebhook: m,
|
|
75
|
+
deleteWebhook: h,
|
|
76
|
+
dashboards: (d.data?.listDashboards?.edges ?? []).map((e) => e.node),
|
|
77
|
+
dashboardsLoading: d.loading,
|
|
78
|
+
dashboardsError: d.error?.message ?? null
|
|
116
79
|
};
|
|
117
80
|
}
|
|
118
81
|
//#endregion
|
|
119
|
-
export { a as HB_WEBHOOK_EVENTS,
|
|
82
|
+
export { a as HB_WEBHOOK_EVENTS, d as useReportsApi };
|
|
120
83
|
|
|
121
84
|
//# sourceMappingURL=useReportsApi.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useReportsApi.js","names":[],"sources":["../../../src/healthybowl/hooks/useReportsApi.ts"],"sourcesContent":["/**\n * Reports & API management hook (roadmap #19 — Custom Report Builder & Developer API).\n *\n * HealthyBowl owns ONLY the \"Reports & API\" management surface; the engines are reused\n * from sibling products over the workspace gateway (no new HB charting / API / webhook\n * engine — see spec §5):\n *\n * · API keys → wspace-analytics-svc
|
|
1
|
+
{"version":3,"file":"useReportsApi.js","names":[],"sources":["../../../src/healthybowl/hooks/useReportsApi.ts"],"sourcesContent":["/**\n * Reports & API management hook (roadmap #19 — Custom Report Builder & Developer API).\n *\n * HealthyBowl owns ONLY the \"Reports & API\" management surface; the engines are reused\n * from sibling products over the workspace gateway (no new HB charting / API / webhook\n * engine — see spec §5):\n *\n * · API keys → REMOVED. wspace-analytics-svc dropped its local API-key stack in\n * 958e761 (\"global-auth-svc is the canonical owner\"): no code path\n * ever read `analytics_api_keys` to authenticate, and it stored the\n * raw key rather than a hash — it minted credentials nothing could\n * redeem. global-auth-svc owns `myApiKeys` / `generateAPIKey` at\n * GLOBAL scope; restoring a key surface here is a feature, not a\n * re-point (it needs an appId, and no revoke op is exposed).\n * · Webhooks → the platform webhook engine (`webhooks` / `createWebhook` /\n * `deleteWebhook`, RBAC resource `webhook`, vibecontrols-owned). Events\n * are free-form strings; HB subscribes its domain events by name.\n * · Dashboards → BigConsole (`listDashboards`, RBAC resource `bigconsole-dashboard`) —\n * the saved no-code dashboards a farmer builds in the BigConsole app.\n *\n * Every read uses `errorPolicy: 'all'` so a cross-product RBAC denial or a cold subgraph\n * degrades to an empty list + a surfaced error, never a page crash — these composed ops\n * depend on cross-product RBAC seeding that is provisioned per environment.\n *\n * Mirrors the hand-written raw-`gql` pattern used across HB (see `useSuppliers`,\n * `useAuctions`) because the offline codegen does not type these composed operations.\n * @module healthybowl\n */\nimport { useCallback } from 'react';\nimport { gql } from '@apollo/client';\nimport { useMutation, useQuery } from '@apollo/client/react';\nimport { useHealthyBowl } from '../context/HealthyBowlContext';\n\n/** An outbound webhook subscription (platform webhook engine). */\nexport interface HBWebhook {\n id: string;\n name: string;\n url: string;\n events: string[];\n isActive: boolean;\n lastDelivery?: string | null;\n lastError?: string | null;\n deliveryCount: number;\n failureCount: number;\n createdAt: string;\n}\n\n/** A saved BigConsole dashboard (report builder output). */\nexport interface HBDashboard {\n id: string;\n name: string;\n category: string;\n updatedAt: string;\n}\n\n/** The HB domain events a workspace can subscribe a webhook to (spec §3, gap M-2). */\nexport const HB_WEBHOOK_EVENTS = [\n { value: 'healthybowl.harvest.created', label: 'Harvest recorded (harvest.created)' },\n { value: 'healthybowl.order.paid', label: 'Order paid (order.paid)' },\n] as const;\n\nconst WEBHOOK_FIELDS = `\n id\n name\n url\n events\n isActive\n lastDelivery\n lastError\n deliveryCount\n failureCount\n createdAt\n`;\n\nconst WEBHOOKS_QUERY = gql`\n query HealthyBowlWebhooks {\n webhooks {\n items {\n ${WEBHOOK_FIELDS}\n }\n total\n }\n }\n`;\n\nconst CREATE_WEBHOOK = gql`\n mutation HealthyBowlCreateWebhook($input: CreateWebhookInput!) {\n createWebhook(input: $input) {\n ${WEBHOOK_FIELDS}\n }\n }\n`;\n\nconst DELETE_WEBHOOK = gql`\n mutation HealthyBowlDeleteWebhook($id: ID!) {\n deleteWebhook(id: $id)\n }\n`;\n\nconst DASHBOARDS_QUERY = gql`\n query HealthyBowlBigConsoleDashboards($first: Int) {\n listDashboards(first: $first) {\n totalCount\n edges {\n node {\n id\n name\n category\n updatedAt\n }\n }\n }\n }\n`;\n\ninterface WebhooksData {\n webhooks: { items: HBWebhook[]; total: number };\n}\ninterface DashboardsData {\n listDashboards: { totalCount: number; edges: { node: HBDashboard }[] };\n}\n\n/** Editable fields for a new webhook subscription (context is attached from the hook). */\nexport interface WebhookInput {\n name: string;\n url: string;\n events: string[];\n}\n\n/**\n * Loads the workspace's API keys, webhook subscriptions and saved BigConsole\n * dashboards, and exposes create/revoke/delete helpers. Mutations refetch their\n * list so the caller's view stays in sync. Reads never throw — a denied or cold\n * composed op surfaces as an error string with an empty list.\n */\nexport function useReportsApi() {\n const { workspaceId } = useHealthyBowl();\n const context = { workspaceId };\n\n const webhooksQuery = useQuery<WebhooksData>(WEBHOOKS_QUERY, {\n skip: !workspaceId,\n fetchPolicy: 'cache-and-network',\n notifyOnNetworkStatusChange: true,\n errorPolicy: 'all',\n });\n\n const dashboardsQuery = useQuery<DashboardsData>(DASHBOARDS_QUERY, {\n variables: { first: 50 },\n skip: !workspaceId,\n fetchPolicy: 'cache-and-network',\n notifyOnNetworkStatusChange: true,\n errorPolicy: 'all',\n });\n\n const [createWebhookMutation] = useMutation(CREATE_WEBHOOK);\n const [deleteWebhookMutation] = useMutation(DELETE_WEBHOOK);\n\n const createWebhook = useCallback(\n async (input: WebhookInput) => {\n await createWebhookMutation({ variables: { input: { ...input, context } } });\n await webhooksQuery.refetch();\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [createWebhookMutation, webhooksQuery, workspaceId]\n );\n\n const deleteWebhook = useCallback(\n async (id: string) => {\n await deleteWebhookMutation({ variables: { id } });\n await webhooksQuery.refetch();\n },\n [deleteWebhookMutation, webhooksQuery]\n );\n\n return {\n // Webhooks\n webhooks: webhooksQuery.data?.webhooks?.items ?? [],\n webhooksLoading: webhooksQuery.loading,\n webhooksError: webhooksQuery.error?.message ?? null,\n createWebhook,\n deleteWebhook,\n // Dashboards (BigConsole)\n dashboards: (dashboardsQuery.data?.listDashboards?.edges ?? []).map((e) => e.node),\n dashboardsLoading: dashboardsQuery.loading,\n dashboardsError: dashboardsQuery.error?.message ?? null,\n };\n}\n"],"mappings":";;;;;AAwDA,IAAa,IAAoB,CAC/B;CAAE,OAAO;CAA+B,OAAO;CAAsC,EACrF;CAAE,OAAO;CAA0B,OAAO;CAA2B,CACtE,EAEK,IAAiB,4HAajB,IAAiB,CAAG;;;;UAIhB,EAAe;;;;;GAOnB,IAAiB,CAAG;;;QAGlB,EAAe;;;GAKjB,IAAiB,CAAG;;;;GAMpB,IAAmB,CAAG;;;;;;;;;;;;;;;AAoC5B,SAAgB,IAAgB;CAC9B,IAAM,EAAE,mBAAgB,GAAgB,EAClC,IAAU,EAAE,gBAAa,EAEzB,IAAgB,EAAuB,GAAgB;EAC3D,MAAM,CAAC;EACP,aAAa;EACb,6BAA6B;EAC7B,aAAa;EACd,CAAC,EAEI,IAAkB,EAAyB,GAAkB;EACjE,WAAW,EAAE,OAAO,IAAI;EACxB,MAAM,CAAC;EACP,aAAa;EACb,6BAA6B;EAC7B,aAAa;EACd,CAAC,EAEI,CAAC,KAAyB,EAAY,EAAe,EACrD,CAAC,KAAyB,EAAY,EAAe,EAErD,IAAgB,EACpB,OAAO,MAAwB;AAE7B,EADA,MAAM,EAAsB,EAAE,WAAW,EAAE,OAAO;GAAE,GAAG;GAAO;GAAS,EAAE,EAAE,CAAC,EAC5E,MAAM,EAAc,SAAS;IAG/B;EAAC;EAAuB;EAAe;EAAY,CACpD,EAEK,IAAgB,EACpB,OAAO,MAAe;AAEpB,EADA,MAAM,EAAsB,EAAE,WAAW,EAAE,OAAI,EAAE,CAAC,EAClD,MAAM,EAAc,SAAS;IAE/B,CAAC,GAAuB,EAAc,CACvC;AAED,QAAO;EAEL,UAAU,EAAc,MAAM,UAAU,SAAS,EAAE;EACnD,iBAAiB,EAAc;EAC/B,eAAe,EAAc,OAAO,WAAW;EAC/C;EACA;EAEA,aAAa,EAAgB,MAAM,gBAAgB,SAAS,EAAE,EAAE,KAAK,MAAM,EAAE,KAAK;EAClF,mBAAmB,EAAgB;EACnC,iBAAiB,EAAgB,OAAO,WAAW;EACpD"}
|
|
@@ -20,7 +20,7 @@ import { Button as h, Select as g, SelectContent as _, SelectItem as v, SelectTr
|
|
|
20
20
|
var x = {
|
|
21
21
|
topic: "",
|
|
22
22
|
requestedDate: "",
|
|
23
|
-
mode: "
|
|
23
|
+
mode: "phone",
|
|
24
24
|
notes: ""
|
|
25
25
|
}, S = {
|
|
26
26
|
name: "",
|
|
@@ -66,20 +66,13 @@ function Ee(t) {
|
|
|
66
66
|
return Array.from({ length: 5 }, (n, r) => /* @__PURE__ */ p(d, { className: e("h-3.5 w-3.5", r < Math.round(t) ? "fill-warning text-warning" : "text-muted") }, r));
|
|
67
67
|
}
|
|
68
68
|
var C = () => {
|
|
69
|
-
let { t: C } = le(), { experts: w, consultations: De, createConsultation: Oe, createExpert: ke, updateExpert: Ae, deleteExpert: je, errors: Me, loadings: Ne, refetch: Pe } = oe(), Fe = [
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
label: C("healthybowl.network.experts.modes.phone", "Phone call")
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
value: "in_person",
|
|
80
|
-
label: C("healthybowl.network.experts.modes.inPerson", "In person")
|
|
81
|
-
}
|
|
82
|
-
], T = {
|
|
69
|
+
let { t: C } = le(), { experts: w, consultations: De, createConsultation: Oe, createExpert: ke, updateExpert: Ae, deleteExpert: je, errors: Me, loadings: Ne, refetch: Pe } = oe(), Fe = [{
|
|
70
|
+
value: "phone",
|
|
71
|
+
label: C("healthybowl.network.experts.modes.phone", "Phone call")
|
|
72
|
+
}, {
|
|
73
|
+
value: "in_person",
|
|
74
|
+
label: C("healthybowl.network.experts.modes.inPerson", "In person")
|
|
75
|
+
}], T = {
|
|
83
76
|
rating: C("healthybowl.network.experts.sort.rating", "Rating"),
|
|
84
77
|
experience: C("healthybowl.network.experts.sort.experience", "Experience"),
|
|
85
78
|
"price-asc": C("healthybowl.network.experts.sort.priceAsc", "Price: Low → High"),
|
|
@@ -105,7 +98,7 @@ var C = () => {
|
|
|
105
98
|
COMPLETED: C("healthybowl.network.experts.consultationStatus.completed", "COMPLETED"),
|
|
106
99
|
CANCELLED: C("healthybowl.network.experts.consultationStatus.cancelled", "CANCELLED")
|
|
107
100
|
}, Be = {
|
|
108
|
-
video: C("healthybowl.network.experts.modes.video", "Video call"),
|
|
101
|
+
video: C("healthybowl.network.experts.modes.video", "Video call (coming soon)"),
|
|
109
102
|
phone: C("healthybowl.network.experts.modes.phone", "Phone call"),
|
|
110
103
|
in_person: C("healthybowl.network.experts.modes.inPerson", "In person")
|
|
111
104
|
}, [E, D] = c(""), [O, k] = c("All"), [A, j] = c("All"), [M, Ve] = c("rating"), [He, N] = c(!1), [Ue, We] = c(null), [P, F] = c(null), [I, L] = c(x), [R, z] = c(!1), [Ge, B] = c(!1), [V, H] = c(null), [U, W] = c(S), [G, K] = c(!1), [Ke, q] = c(null), qe = [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpertsPage.js","names":[],"sources":["../../../../src/healthybowl/pages/network/ExpertsPage.tsx"],"sourcesContent":["import { useState, useRef, useEffect, type FC } from 'react';\nimport {\n Star,\n MapPin,\n Clock,\n Globe,\n Award,\n ArrowUpDown,\n ChevronDown,\n Eye,\n User,\n Zap,\n CalendarCheck,\n Plus,\n Pencil,\n Trash2,\n} from 'lucide-react';\nimport {\n PageLayout,\n StatCard,\n FilterBar,\n StatusBadge,\n EmptyState,\n ErrorState,\n PageLoader,\n Modal,\n} from '../../components';\nimport { ToastContainer } from '../../components/Toast';\nimport { Button, Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@burdenoff/fe-libs/ui';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { useToast } from '../../hooks/useToast';\nimport { useHealthyBowlData } from '../../hooks/useHealthyBowlData';\nimport type { Expert, ConsultationStatus, ConsultationMode } from '../../types';\nimport { cn, formatCurrency, formatDateOnly, todayLocalDate } from '../../utils/helpers';\n\ntype BookingFormState = {\n topic: string;\n requestedDate: string;\n mode: string;\n notes: string;\n};\n\nconst emptyBookingForm: BookingFormState = {\n topic: '',\n requestedDate: '',\n mode: 'video',\n notes: '',\n};\n\ntype ExpertFormState = {\n name: string;\n specialization: string;\n experience: string;\n rating: string;\n location: string;\n availability: 'available' | 'busy' | 'offline';\n hourlyRate: string;\n languages: string;\n};\n\nconst emptyExpertForm: ExpertFormState = {\n name: '',\n specialization: '',\n experience: '',\n rating: '',\n location: '',\n availability: 'available',\n hourlyRate: '',\n languages: '',\n};\n\nconst consultationStatusVariant = (s: ConsultationStatus) => {\n switch (s) {\n case 'CONFIRMED':\n return 'success' as const;\n case 'COMPLETED':\n return 'info' as const;\n case 'CANCELLED':\n return 'muted' as const;\n case 'REQUESTED':\n default:\n return 'warning' as const;\n }\n};\n\nconst specializations = [\n 'All',\n 'Organic Crop Science',\n 'Integrated Pest Management',\n 'Soil Science & Fertility',\n 'Livestock & Veterinary',\n 'Organic Certification',\n];\nconst availabilityOptions = ['All', 'Available', 'Busy'];\n\ntype SortOption = 'rating' | 'experience' | 'price-asc' | 'price-desc';\nconst sortOrder: SortOption[] = ['rating', 'experience', 'price-asc', 'price-desc'];\n\nconst availabilityVariant = (a: string) => {\n switch (a) {\n case 'available':\n return 'success' as const;\n case 'busy':\n return 'warning' as const;\n case 'offline':\n return 'muted' as const;\n default:\n return 'default' as const;\n }\n};\n\nfunction renderStars(rating: number) {\n return Array.from({ length: 5 }, (_, i) => (\n <Star key={i} className={cn('h-3.5 w-3.5', i < Math.round(rating) ? 'fill-warning text-warning' : 'text-muted')} />\n ));\n}\n\nexport const ExpertsPage: FC = () => {\n const { t } = useI18n();\n const {\n experts,\n consultations,\n createConsultation,\n createExpert,\n updateExpert,\n deleteExpert,\n errors,\n loadings,\n refetch,\n } = useHealthyBowlData();\n\n const consultationModes = [\n { value: 'video', label: t('healthybowl.network.experts.modes.video', 'Video call') },\n { value: 'phone', label: t('healthybowl.network.experts.modes.phone', 'Phone call') },\n { value: 'in_person', label: t('healthybowl.network.experts.modes.inPerson', 'In person') },\n ];\n\n const sortLabels: Record<SortOption, string> = {\n rating: t('healthybowl.network.experts.sort.rating', 'Rating'),\n experience: t('healthybowl.network.experts.sort.experience', 'Experience'),\n 'price-asc': t('healthybowl.network.experts.sort.priceAsc', 'Price: Low → High'),\n 'price-desc': t('healthybowl.network.experts.sort.priceDesc', 'Price: High → Low'),\n };\n\n const specializationLabels: Record<string, string> = {\n All: t('healthybowl.common.all', 'All'),\n 'Organic Crop Science': t('healthybowl.network.experts.specializations.organicCropScience', 'Organic Crop Science'),\n 'Integrated Pest Management': t(\n 'healthybowl.network.experts.specializations.integratedPestManagement',\n 'Integrated Pest Management'\n ),\n 'Soil Science & Fertility': t(\n 'healthybowl.network.experts.specializations.soilScienceFertility',\n 'Soil Science & Fertility'\n ),\n 'Livestock & Veterinary': t(\n 'healthybowl.network.experts.specializations.livestockVeterinary',\n 'Livestock & Veterinary'\n ),\n 'Organic Certification': t(\n 'healthybowl.network.experts.specializations.organicCertification',\n 'Organic Certification'\n ),\n };\n\n const availabilityFilterLabels: Record<string, string> = {\n All: t('healthybowl.common.all', 'All'),\n Available: t('healthybowl.network.experts.availabilityFilter.available', 'Available'),\n Busy: t('healthybowl.network.experts.availabilityFilter.busy', 'Busy'),\n };\n\n const availabilityDisplayLabels: Record<string, string> = {\n available: t('healthybowl.network.experts.availability.available', 'available'),\n busy: t('healthybowl.network.experts.availability.busy', 'busy'),\n offline: t('healthybowl.network.experts.availability.offline', 'offline'),\n };\n\n const consultationStatusLabels: Record<ConsultationStatus, string> = {\n REQUESTED: t('healthybowl.network.experts.consultationStatus.requested', 'REQUESTED'),\n CONFIRMED: t('healthybowl.network.experts.consultationStatus.confirmed', 'CONFIRMED'),\n COMPLETED: t('healthybowl.network.experts.consultationStatus.completed', 'COMPLETED'),\n CANCELLED: t('healthybowl.network.experts.consultationStatus.cancelled', 'CANCELLED'),\n };\n\n const consultationModeLabels: Record<string, string> = {\n video: t('healthybowl.network.experts.modes.video', 'Video call'),\n phone: t('healthybowl.network.experts.modes.phone', 'Phone call'),\n in_person: t('healthybowl.network.experts.modes.inPerson', 'In person'),\n };\n\n const [search, setSearch] = useState('');\n const [specFilter, setSpecFilter] = useState('All');\n const [availFilter, setAvailFilter] = useState('All');\n const [sort, setSort] = useState<SortOption>('rating');\n const [showSortDropdown, setShowSortDropdown] = useState(false);\n const [expandedExpert, setExpandedExpert] = useState<string | null>(null);\n const [bookingExpert, setBookingExpert] = useState<Expert | null>(null);\n const [bookingForm, setBookingForm] = useState<BookingFormState>(emptyBookingForm);\n const [submitting, setSubmitting] = useState(false);\n\n const [showExpertModal, setShowExpertModal] = useState(false);\n const [editingExpert, setEditingExpert] = useState<Expert | null>(null);\n const [expertForm, setExpertForm] = useState<ExpertFormState>(emptyExpertForm);\n const [savingExpert, setSavingExpert] = useState(false);\n const [deletingId, setDeletingId] = useState<string | null>(null);\n\n const expertAvailabilityOptions: { value: ExpertFormState['availability']; label: string }[] = [\n { value: 'available', label: t('healthybowl.network.experts.availability.available', 'available') },\n { value: 'busy', label: t('healthybowl.network.experts.availability.busy', 'busy') },\n { value: 'offline', label: t('healthybowl.network.experts.availability.offline', 'offline') },\n ];\n\n const sortRef = useRef<HTMLDivElement>(null);\n const { toasts, toast, dismiss } = useToast();\n\n const expertConsultations = consultations.filter((c) => c.consultantType === 'EXPERT');\n\n const updateBookingForm = <K extends keyof BookingFormState>(key: K, value: BookingFormState[K]) =>\n setBookingForm((prev) => ({ ...prev, [key]: value }));\n\n const openBooking = (expert: Expert) => {\n setBookingForm(emptyBookingForm);\n setBookingExpert(expert);\n };\n\n const closeBooking = () => {\n setBookingExpert(null);\n setBookingForm(emptyBookingForm);\n };\n\n const updateExpertForm = <K extends keyof ExpertFormState>(key: K, value: ExpertFormState[K]) =>\n setExpertForm((prev) => ({ ...prev, [key]: value }));\n\n const openCreateExpert = () => {\n setEditingExpert(null);\n setExpertForm(emptyExpertForm);\n setShowExpertModal(true);\n };\n\n const openEditExpert = (expert: Expert) => {\n setEditingExpert(expert);\n setExpertForm({\n name: expert.name,\n specialization: expert.specialization,\n experience: String(expert.experience),\n rating: String(expert.rating),\n location: expert.location,\n availability: expert.availability,\n hourlyRate: String(expert.hourlyRate),\n languages: (expert.languages ?? []).join(', '),\n });\n setShowExpertModal(true);\n };\n\n const closeExpertModal = () => {\n setShowExpertModal(false);\n setEditingExpert(null);\n setExpertForm(emptyExpertForm);\n };\n\n const handleSaveExpert = async () => {\n if (!expertForm.name.trim() || !expertForm.specialization.trim() || !expertForm.location.trim()) {\n toast({\n title: t('healthybowl.network.experts.form.toast.missingFields.title', 'Missing required fields'),\n description: t(\n 'healthybowl.network.experts.form.toast.missingFields.description',\n 'Name, specialization, and location are required.'\n ),\n variant: 'warning',\n });\n return;\n }\n const languages = expertForm.languages\n .split(',')\n .map((l) => l.trim())\n .filter((l) => l.length > 0);\n setSavingExpert(true);\n try {\n if (editingExpert) {\n await updateExpert({\n id: editingExpert.id,\n name: expertForm.name.trim(),\n specialization: expertForm.specialization.trim(),\n experience: Number(expertForm.experience) || 0,\n rating: Number(expertForm.rating) || 0,\n location: expertForm.location.trim(),\n availability: expertForm.availability,\n hourlyRate: Number(expertForm.hourlyRate) || 0,\n languages,\n });\n toast({\n title: t('healthybowl.network.experts.form.toast.updated.title', 'Expert updated'),\n description: t('healthybowl.network.experts.form.toast.updated.description', '{{name}} has been updated.', {\n name: expertForm.name.trim(),\n }),\n variant: 'success',\n });\n } else {\n await createExpert({\n name: expertForm.name.trim(),\n specialization: expertForm.specialization.trim(),\n experience: Number(expertForm.experience) || 0,\n rating: Number(expertForm.rating) || 0,\n location: expertForm.location.trim(),\n availability: expertForm.availability,\n hourlyRate: Number(expertForm.hourlyRate) || 0,\n languages,\n });\n toast({\n title: t('healthybowl.network.experts.form.toast.created.title', 'Expert added'),\n description: t('healthybowl.network.experts.form.toast.created.description', '{{name}} has been added.', {\n name: expertForm.name.trim(),\n }),\n variant: 'success',\n });\n }\n closeExpertModal();\n } catch (err) {\n toast({\n title: t('healthybowl.network.experts.form.toast.saveError.title', 'Could not save expert'),\n description:\n err instanceof Error\n ? err.message\n : t('healthybowl.network.experts.form.toast.saveError.description', 'Failed to save expert'),\n variant: 'error',\n });\n } finally {\n setSavingExpert(false);\n }\n };\n\n const handleDeleteExpert = async (expert: Expert) => {\n setDeletingId(expert.id);\n try {\n await deleteExpert(expert.id);\n toast({\n title: t('healthybowl.network.experts.form.toast.deleted.title', 'Expert removed'),\n description: t('healthybowl.network.experts.form.toast.deleted.description', '{{name}} has been removed.', {\n name: expert.name,\n }),\n variant: 'success',\n });\n } catch (err) {\n toast({\n title: t('healthybowl.network.experts.form.toast.deleteError.title', 'Could not remove expert'),\n description:\n err instanceof Error\n ? err.message\n : t('healthybowl.network.experts.form.toast.deleteError.description', 'Failed to remove expert'),\n variant: 'error',\n });\n } finally {\n setDeletingId(null);\n }\n };\n\n const handleBookConsultation = async () => {\n if (!bookingExpert) return;\n if (!bookingForm.topic.trim() || !bookingForm.requestedDate) {\n toast({\n title: t('healthybowl.network.experts.toast.missingFields.title', 'Missing required fields'),\n description: t(\n 'healthybowl.network.experts.toast.missingFields.description',\n 'Topic and preferred date are required.'\n ),\n variant: 'warning',\n });\n return;\n }\n setSubmitting(true);\n try {\n await createConsultation({\n consultantType: 'EXPERT',\n consultantId: bookingExpert.id,\n consultantName: bookingExpert.name,\n topic: bookingForm.topic.trim(),\n requestedDate: bookingForm.requestedDate,\n // The mode <select> only offers the three ConsultationMode values.\n mode: bookingForm.mode as ConsultationMode,\n notes: bookingForm.notes.trim() || undefined,\n fee: bookingExpert.hourlyRate,\n });\n toast({\n title: t('healthybowl.network.experts.toast.requested.title', 'Consultation requested'),\n description: t(\n 'healthybowl.network.experts.toast.requested.description',\n 'Your request to {{name}} has been sent.',\n { name: bookingExpert.name }\n ),\n variant: 'success',\n });\n closeBooking();\n } catch (err) {\n toast({\n title: t('healthybowl.network.experts.toast.bookFailed.title', 'Could not book consultation'),\n description:\n err instanceof Error\n ? err.message\n : t('healthybowl.network.experts.toast.bookFailed.description', 'Failed to book consultation'),\n variant: 'error',\n });\n } finally {\n setSubmitting(false);\n }\n };\n\n // Close sort dropdown on outside click\n useEffect(() => {\n const handleClick = (e: MouseEvent) => {\n if (sortRef.current && !sortRef.current.contains(e.target as Node)) {\n setShowSortDropdown(false);\n }\n };\n document.addEventListener('mousedown', handleClick);\n return () => document.removeEventListener('mousedown', handleClick);\n }, []);\n\n // Filter and sort\n const filtered = experts\n .filter((e) => {\n const matchSearch =\n (e.name ?? '').toLowerCase().includes(search.toLowerCase()) ||\n e.specialization.toLowerCase().includes(search.toLowerCase()) ||\n e.location.toLowerCase().includes(search.toLowerCase());\n const matchSpec = specFilter === 'All' || e.specialization === specFilter;\n const matchAvail = availFilter === 'All' || e.availability === availFilter.toLowerCase();\n return matchSearch && matchSpec && matchAvail;\n })\n .sort((a, b) => {\n switch (sort) {\n case 'rating':\n return b.rating - a.rating;\n case 'experience':\n return b.experience - a.experience;\n case 'price-asc':\n return a.hourlyRate - b.hourlyRate;\n case 'price-desc':\n return b.hourlyRate - a.hourlyRate;\n default:\n return 0;\n }\n });\n\n const availableCount = experts.filter((e) => e.availability === 'available').length;\n const avgRating =\n experts.length > 0 ? (experts.reduce((sum, e) => sum + e.rating, 0) / experts.length).toFixed(1) : '0.0';\n const uniqueSpecs = new Set(experts.map((e) => e.specialization)).size;\n\n return (\n <PageLayout\n title={t('healthybowl.network.experts.title', 'Expert Directory')}\n description={t('healthybowl.network.experts.description', 'Find and connect with agricultural experts')}\n purpose=\"Find agricultural specialists — agronomists, vets, soil scientists — and reach out for help. When you hit a problem outside your experience, this directory connects you with someone who knows the answer.\"\n actions={\n <Button onClick={openCreateExpert} size=\"sm\">\n <Plus className=\"h-3.5 w-3.5\" /> {t('healthybowl.network.experts.actions.addExpert', 'Add Expert')}\n </Button>\n }\n >\n {/* Stats */}\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4\">\n <StatCard\n hero\n label={t('healthybowl.network.experts.stats.totalExperts', 'Total Experts')}\n value={experts.length}\n icon={<Award className=\"h-4 w-4\" />}\n />\n <StatCard\n label={t('healthybowl.network.experts.stats.availableNow', 'Available Now')}\n value={availableCount}\n icon={<Zap className=\"h-4 w-4\" />}\n />\n <StatCard\n label={t('healthybowl.network.experts.stats.avgRating', 'Avg Rating')}\n value={avgRating}\n icon={<Star className=\"h-4 w-4\" />}\n />\n <StatCard\n label={t('healthybowl.network.experts.stats.specializations', 'Specializations')}\n value={uniqueSpecs}\n icon={<User className=\"h-4 w-4\" />}\n />\n </div>\n\n {/* Filter Bar */}\n <FilterBar\n searchValue={search}\n onSearchChange={setSearch}\n searchPlaceholder={t(\n 'healthybowl.network.experts.searchPlaceholder',\n 'Search experts by name, specialty, or location...'\n )}\n filters={\n <div className=\"flex flex-wrap items-center gap-2\">\n {/* Specialization filter */}\n <Select value={specFilter} onValueChange={setSpecFilter}>\n <SelectTrigger className=\"h-8 w-auto text-xs\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {specializations.map((s) => (\n <SelectItem key={s} value={s}>\n {specializationLabels[s] ?? s}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n\n {/* Availability filter */}\n <Select value={availFilter} onValueChange={setAvailFilter}>\n <SelectTrigger className=\"h-8 w-auto text-xs\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {availabilityOptions.map((a) => (\n <SelectItem key={a} value={a}>\n {availabilityFilterLabels[a] ?? a}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n\n {/* Sort dropdown */}\n <div ref={sortRef} className=\"relative\">\n <Button onClick={() => setShowSortDropdown((prev) => !prev)} variant=\"outline\" size=\"sm\">\n <ArrowUpDown className=\"h-3.5 w-3.5\" />\n {sortLabels[sort]}\n <ChevronDown className=\"h-3 w-3\" />\n </Button>\n {showSortDropdown && (\n <div className=\"absolute right-0 z-10 mt-1 w-44 rounded-md border border-border-subtle bg-bg-surface py-1 shadow-lg\">\n {sortOrder.map((key) => (\n <button\n key={key}\n type=\"button\"\n onClick={() => {\n setSort(key);\n setShowSortDropdown(false);\n }}\n className={cn(\n 'flex w-full items-center px-3 py-1.5 text-xs hover:bg-bg-sunken',\n sort === key ? 'font-semibold text-primary' : 'text-text-primary'\n )}\n >\n {sortLabels[key]}\n </button>\n ))}\n </div>\n )}\n </div>\n </div>\n }\n />\n\n {/* Expert Cards */}\n {filtered.length > 0 ? (\n <div className=\"grid gap-4 sm:grid-cols-2 lg:grid-cols-3\">\n {filtered.map((expert) => {\n const isExpanded = expandedExpert === expert.id;\n return (\n <div\n key={expert.id}\n className=\"rounded-lg border border-border-subtle bg-bg-surface p-5 transition-colors hover:border-primary/20\"\n >\n {/* Header */}\n <div className=\"flex items-start gap-3\">\n <div className=\"flex h-12 w-12 items-center justify-center rounded-full bg-bg-sunken text-sm font-bold text-text-primary\">\n {(expert.name ?? '')\n .split(' ')\n .map((n) => n[0])\n .join('')}\n </div>\n <div className=\"flex-1 min-w-0\">\n <h3 className=\"text-sm font-semibold text-text-primary\">{expert.name}</h3>\n <p className=\"text-xs text-text-secondary\">{expert.specialization}</p>\n </div>\n <StatusBadge\n label={availabilityDisplayLabels[expert.availability] ?? expert.availability}\n variant={availabilityVariant(expert.availability)}\n dot\n />\n </div>\n\n {/* Info */}\n <div className=\"mt-3 space-y-1.5 text-xs text-text-secondary\">\n <p className=\"flex items-center gap-1.5\">\n <Clock className=\"h-3 w-3\" />{' '}\n {t('healthybowl.network.experts.card.yearsExperience', '{{count}} years experience', {\n count: expert.experience,\n })}\n </p>\n <p className=\"flex items-center gap-1.5\">\n <MapPin className=\"h-3 w-3\" /> {expert.location}\n </p>\n <p className=\"flex items-center gap-1.5\">\n <Globe className=\"h-3 w-3\" /> {(expert.languages ?? []).join(', ')}\n </p>\n </div>\n\n {/* Rating */}\n <div className=\"mt-3 flex items-center gap-1\">\n {renderStars(expert.rating)}\n <span className=\"ml-1 text-xs font-medium text-text-primary\">{expert.rating}</span>\n <span className=\"text-xs text-text-secondary\">\n {t('healthybowl.network.experts.card.reviews', '({{count}} reviews)', { count: expert.reviews })}\n </span>\n </div>\n\n {/* Expanded Profile */}\n {isExpanded && (\n <div className=\"mt-3 rounded-md border border-border-subtle bg-bg-sunken/50 p-3\">\n <h4 className=\"text-xs font-semibold text-text-primary\">\n {t('healthybowl.network.experts.card.about', 'About')}\n </h4>\n <p className=\"mt-1 text-xs text-text-secondary\">\n {t(\n 'healthybowl.network.experts.card.aboutText',\n '{{name}} is a seasoned agricultural expert specializing in {{specialization}} with {{count}} years of field and research experience. Known for practical, evidence-based consulting that delivers measurable results.',\n {\n name: expert.name,\n specialization: (expert.specialization ?? '').toLowerCase(),\n count: expert.experience,\n }\n )}\n </p>\n <div className=\"mt-2 grid grid-cols-2 gap-2 text-xs\">\n <div className=\"rounded bg-bg-surface p-2\">\n <p className=\"font-medium text-text-primary\">\n {t('healthybowl.network.experts.card.pastConsultations', 'Past Consultations')}\n </p>\n <p className=\"text-text-secondary\">{expert.reviews * 3}+</p>\n </div>\n <div className=\"rounded bg-bg-surface p-2\">\n <p className=\"font-medium text-text-primary\">\n {t('healthybowl.network.experts.card.avgResponse', 'Avg Response')}\n </p>\n <p className=\"text-text-secondary\">\n {t('healthybowl.network.experts.card.avgResponseValue', '< 2 hours')}\n </p>\n </div>\n </div>\n </div>\n )}\n\n {/* Footer */}\n <div className=\"mt-3 flex items-center justify-between border-t border-border-subtle pt-3\">\n <span className=\"text-sm font-medium text-text-primary\">\n {t('healthybowl.network.experts.card.pricePerHour', '{{price}}/hr', {\n price: formatCurrency(expert.hourlyRate),\n })}\n </span>\n <div className=\"flex items-center gap-2\">\n <Button\n onClick={() => setExpandedExpert(isExpanded ? null : expert.id)}\n aria-label={t('healthybowl.network.experts.actions.viewProfile', 'View profile')}\n variant=\"outline\"\n size=\"icon-sm\"\n >\n <Eye className=\"h-3.5 w-3.5\" />\n </Button>\n <Button\n onClick={() => openEditExpert(expert)}\n aria-label={t('healthybowl.network.experts.actions.editExpert', 'Edit expert')}\n variant=\"outline\"\n size=\"icon-sm\"\n >\n <Pencil className=\"h-3.5 w-3.5\" />\n </Button>\n <Button\n onClick={() => handleDeleteExpert(expert)}\n disabled={deletingId === expert.id}\n aria-label={t('healthybowl.network.experts.actions.deleteExpert', 'Delete expert')}\n variant=\"ghost\"\n size=\"icon-sm\"\n className=\"text-status-error-text hover:bg-status-error-bg/10 hover:text-status-error-text\"\n >\n <Trash2 className=\"h-3.5 w-3.5\" />\n </Button>\n <Button onClick={() => openBooking(expert)} size=\"sm\">\n <CalendarCheck className=\"h-3.5 w-3.5\" />{' '}\n {t('healthybowl.network.experts.actions.bookConsultation', 'Book Consultation')}\n </Button>\n </div>\n </div>\n </div>\n );\n })}\n </div>\n ) : experts.length === 0 ? (\n loadings.network ? (\n <PageLoader />\n ) : errors.network ? (\n <ErrorState onRetry={refetch} />\n ) : (\n <EmptyState\n illustration=\"empty-people\"\n title={t('healthybowl.network.experts.emptyState.none.title', 'No experts available yet')}\n description={t(\n 'healthybowl.network.experts.emptyState.none.description',\n 'There are no agricultural experts in your network yet. Add one to get started.'\n )}\n action={\n <Button onClick={openCreateExpert}>\n <Plus className=\"h-3.5 w-3.5\" /> {t('healthybowl.network.experts.actions.addExpert', 'Add Expert')}\n </Button>\n }\n />\n )\n ) : (\n <EmptyState\n illustration=\"empty-search\"\n title={t('healthybowl.network.experts.emptyState.noMatch.title', 'No experts found')}\n description={t(\n 'healthybowl.network.experts.emptyState.noMatch.description',\n 'No experts match your current filters. Try broadening your search.'\n )}\n action={\n <Button\n onClick={() => {\n setSearch('');\n setSpecFilter('All');\n setAvailFilter('All');\n }}\n >\n {t('healthybowl.network.experts.actions.clearFilters', 'Clear Filters')}\n </Button>\n }\n />\n )}\n\n {/* My bookings */}\n {expertConsultations.length > 0 && (\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-5\">\n <h3 className=\"flex items-center gap-2 text-sm font-semibold text-text-primary\">\n <CalendarCheck className=\"h-4 w-4\" />{' '}\n {t('healthybowl.network.experts.myConsultations.heading', 'My Expert Consultations')}\n </h3>\n <ul className=\"mt-3 divide-y divide-border\">\n {expertConsultations.map((c) => (\n <li key={c.id} className=\"flex items-center justify-between gap-3 py-2.5\">\n <div className=\"min-w-0\">\n <p className=\"truncate text-sm font-medium text-text-primary\">{c.topic}</p>\n <p className=\"text-xs text-text-secondary\">\n {c.consultantName} · {formatDateOnly(c.requestedDate)} ·{' '}\n {consultationModeLabels[c.mode] ?? c.mode}\n </p>\n </div>\n <StatusBadge\n label={consultationStatusLabels[c.status] ?? c.status}\n variant={consultationStatusVariant(c.status)}\n dot\n />\n </li>\n ))}\n </ul>\n </div>\n )}\n\n {/* Booking Modal */}\n <Modal\n open={bookingExpert !== null}\n onClose={closeBooking}\n title={t('healthybowl.network.experts.bookingModal.title', 'Book Consultation')}\n description={\n bookingExpert\n ? t('healthybowl.network.experts.bookingModal.description', 'Request a session with {{name}}', {\n name: bookingExpert.name,\n })\n : undefined\n }\n footer={\n <>\n <Button onClick={closeBooking} variant=\"outline\">\n {t('healthybowl.common.cancel', 'Cancel')}\n </Button>\n <Button onClick={handleBookConsultation} disabled={submitting}>\n {submitting\n ? t('healthybowl.network.experts.bookingModal.booking', 'Booking…')\n : t('healthybowl.network.experts.bookingModal.confirm', 'Confirm Booking')}\n </Button>\n </>\n }\n >\n <div className=\"space-y-4\">\n <div>\n <label htmlFor=\"expert-booking-topic\" className=\"mb-1 block text-xs font-medium text-text-primary\">\n {t('healthybowl.network.experts.bookingModal.fields.topic.label', 'Topic')}\n </label>\n <input\n id=\"expert-booking-topic\"\n type=\"text\"\n value={bookingForm.topic}\n onChange={(e) => updateBookingForm('topic', e.target.value)}\n maxLength={200}\n placeholder={t(\n 'healthybowl.network.experts.bookingModal.fields.topic.placeholder',\n 'What would you like help with?'\n )}\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n </div>\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2\">\n <div>\n <label htmlFor=\"expert-booking-date\" className=\"mb-1 block text-xs font-medium text-text-primary\">\n {t('healthybowl.network.experts.bookingModal.fields.preferredDate.label', 'Preferred date')}\n </label>\n <input\n id=\"expert-booking-date\"\n type=\"date\"\n value={bookingForm.requestedDate}\n onChange={(e) => updateBookingForm('requestedDate', e.target.value)}\n min={todayLocalDate()}\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n </div>\n <div>\n <label htmlFor=\"expert-booking-mode\" className=\"mb-1 block text-xs font-medium text-text-primary\">\n {t('healthybowl.network.experts.bookingModal.fields.mode.label', 'Mode')}\n </label>\n <Select value={bookingForm.mode} onValueChange={(value) => updateBookingForm('mode', value)}>\n <SelectTrigger id=\"expert-booking-mode\" className=\"w-full\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {consultationModes.map((m) => (\n <SelectItem key={m.value} value={m.value}>\n {m.label}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n </div>\n <div>\n <label htmlFor=\"expert-booking-notes\" className=\"mb-1 block text-xs font-medium text-text-primary\">\n {t('healthybowl.network.experts.bookingModal.fields.notes.label', 'Notes (optional)')}\n </label>\n <textarea\n id=\"expert-booking-notes\"\n value={bookingForm.notes}\n onChange={(e) => updateBookingForm('notes', e.target.value)}\n rows={3}\n maxLength={1000}\n placeholder={t(\n 'healthybowl.network.experts.bookingModal.fields.notes.placeholder',\n 'Any additional context for the expert'\n )}\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n </div>\n {bookingExpert && (\n <p className=\"text-xs text-text-secondary\">\n {t('healthybowl.network.experts.bookingModal.estimatedFee', 'Estimated fee:')}{' '}\n <span className=\"font-medium text-text-primary\">\n {t('healthybowl.network.experts.card.pricePerHour', '{{price}}/hr', {\n price: formatCurrency(bookingExpert.hourlyRate),\n })}\n </span>\n </p>\n )}\n </div>\n </Modal>\n\n {/* Add / Edit Expert Modal */}\n <Modal\n open={showExpertModal}\n onClose={closeExpertModal}\n title={\n editingExpert\n ? t('healthybowl.network.experts.form.editTitle', 'Edit Expert')\n : t('healthybowl.network.experts.form.addTitle', 'Add Expert')\n }\n description={t('healthybowl.network.experts.form.description', 'Manage an expert in your network directory')}\n size=\"lg\"\n footer={\n <>\n <Button onClick={closeExpertModal} variant=\"outline\">\n {t('healthybowl.common.cancel', 'Cancel')}\n </Button>\n <Button onClick={handleSaveExpert} disabled={savingExpert}>\n {savingExpert\n ? t('healthybowl.network.experts.form.saving', 'Saving…')\n : t('healthybowl.network.experts.form.save', 'Save Expert')}\n </Button>\n </>\n }\n >\n <div className=\"space-y-4\">\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2\">\n <div>\n <label htmlFor=\"expert-form-name\" className=\"mb-1 block text-xs font-medium text-text-primary\">\n {t('healthybowl.network.experts.form.fields.name.label', 'Name')}\n </label>\n <input\n id=\"expert-form-name\"\n type=\"text\"\n value={expertForm.name}\n onChange={(e) => updateExpertForm('name', e.target.value)}\n maxLength={120}\n placeholder={t('healthybowl.network.experts.form.fields.name.placeholder', 'Full name')}\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n </div>\n <div>\n <label htmlFor=\"expert-form-specialization\" className=\"mb-1 block text-xs font-medium text-text-primary\">\n {t('healthybowl.network.experts.form.fields.specialization.label', 'Specialization')}\n </label>\n <input\n id=\"expert-form-specialization\"\n type=\"text\"\n value={expertForm.specialization}\n onChange={(e) => updateExpertForm('specialization', e.target.value)}\n maxLength={120}\n placeholder={t(\n 'healthybowl.network.experts.form.fields.specialization.placeholder',\n 'e.g. Soil Science & Fertility'\n )}\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n </div>\n </div>\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-3\">\n <div>\n <label htmlFor=\"expert-form-experience\" className=\"mb-1 block text-xs font-medium text-text-primary\">\n {t('healthybowl.network.experts.form.fields.experience.label', 'Experience (years)')}\n </label>\n <input\n id=\"expert-form-experience\"\n type=\"number\"\n min={0}\n value={expertForm.experience}\n onChange={(e) => updateExpertForm('experience', e.target.value)}\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n </div>\n <div>\n <label htmlFor=\"expert-form-rating\" className=\"mb-1 block text-xs font-medium text-text-primary\">\n {t('healthybowl.network.experts.form.fields.rating.label', 'Rating')}\n </label>\n <input\n id=\"expert-form-rating\"\n type=\"number\"\n min={0}\n max={5}\n step={0.1}\n value={expertForm.rating}\n onChange={(e) => updateExpertForm('rating', e.target.value)}\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n </div>\n <div>\n <label htmlFor=\"expert-form-rate\" className=\"mb-1 block text-xs font-medium text-text-primary\">\n {t('healthybowl.network.experts.form.fields.hourlyRate.label', 'Hourly rate')}\n </label>\n <input\n id=\"expert-form-rate\"\n type=\"number\"\n min={0}\n step={0.01}\n value={expertForm.hourlyRate}\n onChange={(e) => updateExpertForm('hourlyRate', e.target.value)}\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n </div>\n </div>\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2\">\n <div>\n <label htmlFor=\"expert-form-location\" className=\"mb-1 block text-xs font-medium text-text-primary\">\n {t('healthybowl.network.experts.form.fields.location.label', 'Location')}\n </label>\n <input\n id=\"expert-form-location\"\n type=\"text\"\n value={expertForm.location}\n onChange={(e) => updateExpertForm('location', e.target.value)}\n maxLength={120}\n placeholder={t('healthybowl.network.experts.form.fields.location.placeholder', 'City, Region')}\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n </div>\n <div>\n <label htmlFor=\"expert-form-availability\" className=\"mb-1 block text-xs font-medium text-text-primary\">\n {t('healthybowl.network.experts.form.fields.availability.label', 'Availability')}\n </label>\n <Select\n value={expertForm.availability}\n onValueChange={(value) => updateExpertForm('availability', value as ExpertFormState['availability'])}\n >\n <SelectTrigger id=\"expert-form-availability\" className=\"w-full\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {expertAvailabilityOptions.map((o) => (\n <SelectItem key={o.value} value={o.value}>\n {o.label}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n </div>\n <div>\n <label htmlFor=\"expert-form-languages\" className=\"mb-1 block text-xs font-medium text-text-primary\">\n {t('healthybowl.network.experts.form.fields.languages.label', 'Languages')}\n </label>\n <input\n id=\"expert-form-languages\"\n type=\"text\"\n value={expertForm.languages}\n onChange={(e) => updateExpertForm('languages', e.target.value)}\n placeholder={t('healthybowl.network.experts.form.fields.languages.placeholder', 'English, Hindi, Tamil')}\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n <p className=\"mt-1 text-xs text-text-secondary\">\n {t('healthybowl.network.experts.form.fields.languages.hint', 'Separate multiple languages with commas')}\n </p>\n </div>\n </div>\n </Modal>\n\n <ToastContainer toasts={toasts} onDismiss={dismiss} />\n </PageLayout>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA0CA,IAAM,IAAqC;CACzC,OAAO;CACP,eAAe;CACf,MAAM;CACN,OAAO;CACR,EAaK,IAAmC;CACvC,MAAM;CACN,gBAAgB;CAChB,YAAY;CACZ,QAAQ;CACR,UAAU;CACV,cAAc;CACd,YAAY;CACZ,WAAW;CACZ,EAEK,MAA6B,MAA0B;AAC3D,SAAQ,GAAR;EACE,KAAK,YACH,QAAO;EACT,KAAK,YACH,QA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AA,CAAA,EACN,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,SAAD;QAAO,SAAQ;QAA2B,WAAU;kBACjD,EAAE,8DAA8D,eAAe;QAC1E,CAAA,EACR,kBAAC,GAAD;QACE,OAAO,EAAW;QAClB,gBAAgB,MAAU,EAAiB,gBAAgB,EAAyC;kBAFtG,CAIE,kBAAC,GAAD;SAAe,IAAG;SAA2B,WAAU;mBACrD,kBAAC,GAAD,EAAe,CAAA;SACD,CAAA,EAChB,kBAAC,GAAD,EAAA,UACG,GAA0B,KAAK,MAC9B,kBAAC,GAAD;SAA0B,OAAO,EAAE;mBAChC,EAAE;SACQ,EAFI,EAAE,MAEN,CACb,EACY,CAAA,CACT;UACL,EAAA,CAAA,CACF;;MACN,kBAAC,OAAD,EAAA,UAAA;OACE,kBAAC,SAAD;QAAO,SAAQ;QAAwB,WAAU;kBAC9C,EAAE,2DAA2D,YAAY;QACpE,CAAA;OACR,kBAAC,SAAD;QACE,IAAG;QACH,MAAK;QACL,OAAO,EAAW;QAClB,WAAW,MAAM,EAAiB,aAAa,EAAE,OAAO,MAAM;QAC9D,aAAa,EAAE,iEAAiE,wBAAwB;QACxG,WAAU;QACV,CAAA;OACF,kBAAC,KAAD;QAAG,WAAU;kBACV,EAAE,0DAA0D,0CAA0C;QACrG,CAAA;OACA,EAAA,CAAA;MACF;;IACA,CAAA;GAER,kBAAC,IAAD;IAAwB;IAAQ,WAAW;IAAW,CAAA;GAC3C"}
|
|
1
|
+
{"version":3,"file":"ExpertsPage.js","names":[],"sources":["../../../../src/healthybowl/pages/network/ExpertsPage.tsx"],"sourcesContent":["import { useState, useRef, useEffect, type FC } from 'react';\nimport {\n Star,\n MapPin,\n Clock,\n Globe,\n Award,\n ArrowUpDown,\n ChevronDown,\n Eye,\n User,\n Zap,\n CalendarCheck,\n Plus,\n Pencil,\n Trash2,\n} from 'lucide-react';\nimport {\n PageLayout,\n StatCard,\n FilterBar,\n StatusBadge,\n EmptyState,\n ErrorState,\n PageLoader,\n Modal,\n} from '../../components';\nimport { ToastContainer } from '../../components/Toast';\nimport { Button, Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@burdenoff/fe-libs/ui';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { useToast } from '../../hooks/useToast';\nimport { useHealthyBowlData } from '../../hooks/useHealthyBowlData';\nimport type { Expert, ConsultationStatus, ConsultationMode } from '../../types';\nimport { cn, formatCurrency, formatDateOnly, todayLocalDate } from '../../utils/helpers';\n\ntype BookingFormState = {\n topic: string;\n requestedDate: string;\n mode: string;\n notes: string;\n};\n\n// Video consultations are not yet wired to a live provider, so default to\n// phone and do not offer video as a bookable mode until BOFF-4719 is built.\nconst emptyBookingForm: BookingFormState = {\n topic: '',\n requestedDate: '',\n mode: 'phone',\n notes: '',\n};\n\ntype ExpertFormState = {\n name: string;\n specialization: string;\n experience: string;\n rating: string;\n location: string;\n availability: 'available' | 'busy' | 'offline';\n hourlyRate: string;\n languages: string;\n};\n\nconst emptyExpertForm: ExpertFormState = {\n name: '',\n specialization: '',\n experience: '',\n rating: '',\n location: '',\n availability: 'available',\n hourlyRate: '',\n languages: '',\n};\n\nconst consultationStatusVariant = (s: ConsultationStatus) => {\n switch (s) {\n case 'CONFIRMED':\n return 'success' as const;\n case 'COMPLETED':\n return 'info' as const;\n case 'CANCELLED':\n return 'muted' as const;\n case 'REQUESTED':\n default:\n return 'warning' as const;\n }\n};\n\nconst specializations = [\n 'All',\n 'Organic Crop Science',\n 'Integrated Pest Management',\n 'Soil Science & Fertility',\n 'Livestock & Veterinary',\n 'Organic Certification',\n];\nconst availabilityOptions = ['All', 'Available', 'Busy'];\n\ntype SortOption = 'rating' | 'experience' | 'price-asc' | 'price-desc';\nconst sortOrder: SortOption[] = ['rating', 'experience', 'price-asc', 'price-desc'];\n\nconst availabilityVariant = (a: string) => {\n switch (a) {\n case 'available':\n return 'success' as const;\n case 'busy':\n return 'warning' as const;\n case 'offline':\n return 'muted' as const;\n default:\n return 'default' as const;\n }\n};\n\nfunction renderStars(rating: number) {\n return Array.from({ length: 5 }, (_, i) => (\n <Star key={i} className={cn('h-3.5 w-3.5', i < Math.round(rating) ? 'fill-warning text-warning' : 'text-muted')} />\n ));\n}\n\nexport const ExpertsPage: FC = () => {\n const { t } = useI18n();\n const {\n experts,\n consultations,\n createConsultation,\n createExpert,\n updateExpert,\n deleteExpert,\n errors,\n loadings,\n refetch,\n } = useHealthyBowlData();\n\n // Video mode is intentionally omitted from the booking dropdown until the\n // video provider integration is implemented (BOFF-4719). Existing video\n // requests are still displayed with the \"coming soon\" label below.\n const consultationModes = [\n { value: 'phone', label: t('healthybowl.network.experts.modes.phone', 'Phone call') },\n { value: 'in_person', label: t('healthybowl.network.experts.modes.inPerson', 'In person') },\n ];\n\n const sortLabels: Record<SortOption, string> = {\n rating: t('healthybowl.network.experts.sort.rating', 'Rating'),\n experience: t('healthybowl.network.experts.sort.experience', 'Experience'),\n 'price-asc': t('healthybowl.network.experts.sort.priceAsc', 'Price: Low → High'),\n 'price-desc': t('healthybowl.network.experts.sort.priceDesc', 'Price: High → Low'),\n };\n\n const specializationLabels: Record<string, string> = {\n All: t('healthybowl.common.all', 'All'),\n 'Organic Crop Science': t('healthybowl.network.experts.specializations.organicCropScience', 'Organic Crop Science'),\n 'Integrated Pest Management': t(\n 'healthybowl.network.experts.specializations.integratedPestManagement',\n 'Integrated Pest Management'\n ),\n 'Soil Science & Fertility': t(\n 'healthybowl.network.experts.specializations.soilScienceFertility',\n 'Soil Science & Fertility'\n ),\n 'Livestock & Veterinary': t(\n 'healthybowl.network.experts.specializations.livestockVeterinary',\n 'Livestock & Veterinary'\n ),\n 'Organic Certification': t(\n 'healthybowl.network.experts.specializations.organicCertification',\n 'Organic Certification'\n ),\n };\n\n const availabilityFilterLabels: Record<string, string> = {\n All: t('healthybowl.common.all', 'All'),\n Available: t('healthybowl.network.experts.availabilityFilter.available', 'Available'),\n Busy: t('healthybowl.network.experts.availabilityFilter.busy', 'Busy'),\n };\n\n const availabilityDisplayLabels: Record<string, string> = {\n available: t('healthybowl.network.experts.availability.available', 'available'),\n busy: t('healthybowl.network.experts.availability.busy', 'busy'),\n offline: t('healthybowl.network.experts.availability.offline', 'offline'),\n };\n\n const consultationStatusLabels: Record<ConsultationStatus, string> = {\n REQUESTED: t('healthybowl.network.experts.consultationStatus.requested', 'REQUESTED'),\n CONFIRMED: t('healthybowl.network.experts.consultationStatus.confirmed', 'CONFIRMED'),\n COMPLETED: t('healthybowl.network.experts.consultationStatus.completed', 'COMPLETED'),\n CANCELLED: t('healthybowl.network.experts.consultationStatus.cancelled', 'CANCELLED'),\n };\n\n const consultationModeLabels: Record<string, string> = {\n video: t('healthybowl.network.experts.modes.video', 'Video call (coming soon)'),\n phone: t('healthybowl.network.experts.modes.phone', 'Phone call'),\n in_person: t('healthybowl.network.experts.modes.inPerson', 'In person'),\n };\n\n const [search, setSearch] = useState('');\n const [specFilter, setSpecFilter] = useState('All');\n const [availFilter, setAvailFilter] = useState('All');\n const [sort, setSort] = useState<SortOption>('rating');\n const [showSortDropdown, setShowSortDropdown] = useState(false);\n const [expandedExpert, setExpandedExpert] = useState<string | null>(null);\n const [bookingExpert, setBookingExpert] = useState<Expert | null>(null);\n const [bookingForm, setBookingForm] = useState<BookingFormState>(emptyBookingForm);\n const [submitting, setSubmitting] = useState(false);\n\n const [showExpertModal, setShowExpertModal] = useState(false);\n const [editingExpert, setEditingExpert] = useState<Expert | null>(null);\n const [expertForm, setExpertForm] = useState<ExpertFormState>(emptyExpertForm);\n const [savingExpert, setSavingExpert] = useState(false);\n const [deletingId, setDeletingId] = useState<string | null>(null);\n\n const expertAvailabilityOptions: { value: ExpertFormState['availability']; label: string }[] = [\n { value: 'available', label: t('healthybowl.network.experts.availability.available', 'available') },\n { value: 'busy', label: t('healthybowl.network.experts.availability.busy', 'busy') },\n { value: 'offline', label: t('healthybowl.network.experts.availability.offline', 'offline') },\n ];\n\n const sortRef = useRef<HTMLDivElement>(null);\n const { toasts, toast, dismiss } = useToast();\n\n const expertConsultations = consultations.filter((c) => c.consultantType === 'EXPERT');\n\n const updateBookingForm = <K extends keyof BookingFormState>(key: K, value: BookingFormState[K]) =>\n setBookingForm((prev) => ({ ...prev, [key]: value }));\n\n const openBooking = (expert: Expert) => {\n setBookingForm(emptyBookingForm);\n setBookingExpert(expert);\n };\n\n const closeBooking = () => {\n setBookingExpert(null);\n setBookingForm(emptyBookingForm);\n };\n\n const updateExpertForm = <K extends keyof ExpertFormState>(key: K, value: ExpertFormState[K]) =>\n setExpertForm((prev) => ({ ...prev, [key]: value }));\n\n const openCreateExpert = () => {\n setEditingExpert(null);\n setExpertForm(emptyExpertForm);\n setShowExpertModal(true);\n };\n\n const openEditExpert = (expert: Expert) => {\n setEditingExpert(expert);\n setExpertForm({\n name: expert.name,\n specialization: expert.specialization,\n experience: String(expert.experience),\n rating: String(expert.rating),\n location: expert.location,\n availability: expert.availability,\n hourlyRate: String(expert.hourlyRate),\n languages: (expert.languages ?? []).join(', '),\n });\n setShowExpertModal(true);\n };\n\n const closeExpertModal = () => {\n setShowExpertModal(false);\n setEditingExpert(null);\n setExpertForm(emptyExpertForm);\n };\n\n const handleSaveExpert = async () => {\n if (!expertForm.name.trim() || !expertForm.specialization.trim() || !expertForm.location.trim()) {\n toast({\n title: t('healthybowl.network.experts.form.toast.missingFields.title', 'Missing required fields'),\n description: t(\n 'healthybowl.network.experts.form.toast.missingFields.description',\n 'Name, specialization, and location are required.'\n ),\n variant: 'warning',\n });\n return;\n }\n const languages = expertForm.languages\n .split(',')\n .map((l) => l.trim())\n .filter((l) => l.length > 0);\n setSavingExpert(true);\n try {\n if (editingExpert) {\n await updateExpert({\n id: editingExpert.id,\n name: expertForm.name.trim(),\n specialization: expertForm.specialization.trim(),\n experience: Number(expertForm.experience) || 0,\n rating: Number(expertForm.rating) || 0,\n location: expertForm.location.trim(),\n availability: expertForm.availability,\n hourlyRate: Number(expertForm.hourlyRate) || 0,\n languages,\n });\n toast({\n title: t('healthybowl.network.experts.form.toast.updated.title', 'Expert updated'),\n description: t('healthybowl.network.experts.form.toast.updated.description', '{{name}} has been updated.', {\n name: expertForm.name.trim(),\n }),\n variant: 'success',\n });\n } else {\n await createExpert({\n name: expertForm.name.trim(),\n specialization: expertForm.specialization.trim(),\n experience: Number(expertForm.experience) || 0,\n rating: Number(expertForm.rating) || 0,\n location: expertForm.location.trim(),\n availability: expertForm.availability,\n hourlyRate: Number(expertForm.hourlyRate) || 0,\n languages,\n });\n toast({\n title: t('healthybowl.network.experts.form.toast.created.title', 'Expert added'),\n description: t('healthybowl.network.experts.form.toast.created.description', '{{name}} has been added.', {\n name: expertForm.name.trim(),\n }),\n variant: 'success',\n });\n }\n closeExpertModal();\n } catch (err) {\n toast({\n title: t('healthybowl.network.experts.form.toast.saveError.title', 'Could not save expert'),\n description:\n err instanceof Error\n ? err.message\n : t('healthybowl.network.experts.form.toast.saveError.description', 'Failed to save expert'),\n variant: 'error',\n });\n } finally {\n setSavingExpert(false);\n }\n };\n\n const handleDeleteExpert = async (expert: Expert) => {\n setDeletingId(expert.id);\n try {\n await deleteExpert(expert.id);\n toast({\n title: t('healthybowl.network.experts.form.toast.deleted.title', 'Expert removed'),\n description: t('healthybowl.network.experts.form.toast.deleted.description', '{{name}} has been removed.', {\n name: expert.name,\n }),\n variant: 'success',\n });\n } catch (err) {\n toast({\n title: t('healthybowl.network.experts.form.toast.deleteError.title', 'Could not remove expert'),\n description:\n err instanceof Error\n ? err.message\n : t('healthybowl.network.experts.form.toast.deleteError.description', 'Failed to remove expert'),\n variant: 'error',\n });\n } finally {\n setDeletingId(null);\n }\n };\n\n const handleBookConsultation = async () => {\n if (!bookingExpert) return;\n if (!bookingForm.topic.trim() || !bookingForm.requestedDate) {\n toast({\n title: t('healthybowl.network.experts.toast.missingFields.title', 'Missing required fields'),\n description: t(\n 'healthybowl.network.experts.toast.missingFields.description',\n 'Topic and preferred date are required.'\n ),\n variant: 'warning',\n });\n return;\n }\n setSubmitting(true);\n try {\n await createConsultation({\n consultantType: 'EXPERT',\n consultantId: bookingExpert.id,\n consultantName: bookingExpert.name,\n topic: bookingForm.topic.trim(),\n requestedDate: bookingForm.requestedDate,\n // The mode <select> only offers the three ConsultationMode values.\n mode: bookingForm.mode as ConsultationMode,\n notes: bookingForm.notes.trim() || undefined,\n fee: bookingExpert.hourlyRate,\n });\n toast({\n title: t('healthybowl.network.experts.toast.requested.title', 'Consultation requested'),\n description: t(\n 'healthybowl.network.experts.toast.requested.description',\n 'Your request to {{name}} has been sent.',\n { name: bookingExpert.name }\n ),\n variant: 'success',\n });\n closeBooking();\n } catch (err) {\n toast({\n title: t('healthybowl.network.experts.toast.bookFailed.title', 'Could not book consultation'),\n description:\n err instanceof Error\n ? err.message\n : t('healthybowl.network.experts.toast.bookFailed.description', 'Failed to book consultation'),\n variant: 'error',\n });\n } finally {\n setSubmitting(false);\n }\n };\n\n // Close sort dropdown on outside click\n useEffect(() => {\n const handleClick = (e: MouseEvent) => {\n if (sortRef.current && !sortRef.current.contains(e.target as Node)) {\n setShowSortDropdown(false);\n }\n };\n document.addEventListener('mousedown', handleClick);\n return () => document.removeEventListener('mousedown', handleClick);\n }, []);\n\n // Filter and sort\n const filtered = experts\n .filter((e) => {\n const matchSearch =\n (e.name ?? '').toLowerCase().includes(search.toLowerCase()) ||\n e.specialization.toLowerCase().includes(search.toLowerCase()) ||\n e.location.toLowerCase().includes(search.toLowerCase());\n const matchSpec = specFilter === 'All' || e.specialization === specFilter;\n const matchAvail = availFilter === 'All' || e.availability === availFilter.toLowerCase();\n return matchSearch && matchSpec && matchAvail;\n })\n .sort((a, b) => {\n switch (sort) {\n case 'rating':\n return b.rating - a.rating;\n case 'experience':\n return b.experience - a.experience;\n case 'price-asc':\n return a.hourlyRate - b.hourlyRate;\n case 'price-desc':\n return b.hourlyRate - a.hourlyRate;\n default:\n return 0;\n }\n });\n\n const availableCount = experts.filter((e) => e.availability === 'available').length;\n const avgRating =\n experts.length > 0 ? (experts.reduce((sum, e) => sum + e.rating, 0) / experts.length).toFixed(1) : '0.0';\n const uniqueSpecs = new Set(experts.map((e) => e.specialization)).size;\n\n return (\n <PageLayout\n title={t('healthybowl.network.experts.title', 'Expert Directory')}\n description={t('healthybowl.network.experts.description', 'Find and connect with agricultural experts')}\n purpose=\"Find agricultural specialists — agronomists, vets, soil scientists — and reach out for help. When you hit a problem outside your experience, this directory connects you with someone who knows the answer.\"\n actions={\n <Button onClick={openCreateExpert} size=\"sm\">\n <Plus className=\"h-3.5 w-3.5\" /> {t('healthybowl.network.experts.actions.addExpert', 'Add Expert')}\n </Button>\n }\n >\n {/* Stats */}\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4\">\n <StatCard\n hero\n label={t('healthybowl.network.experts.stats.totalExperts', 'Total Experts')}\n value={experts.length}\n icon={<Award className=\"h-4 w-4\" />}\n />\n <StatCard\n label={t('healthybowl.network.experts.stats.availableNow', 'Available Now')}\n value={availableCount}\n icon={<Zap className=\"h-4 w-4\" />}\n />\n <StatCard\n label={t('healthybowl.network.experts.stats.avgRating', 'Avg Rating')}\n value={avgRating}\n icon={<Star className=\"h-4 w-4\" />}\n />\n <StatCard\n label={t('healthybowl.network.experts.stats.specializations', 'Specializations')}\n value={uniqueSpecs}\n icon={<User className=\"h-4 w-4\" />}\n />\n </div>\n\n {/* Filter Bar */}\n <FilterBar\n searchValue={search}\n onSearchChange={setSearch}\n searchPlaceholder={t(\n 'healthybowl.network.experts.searchPlaceholder',\n 'Search experts by name, specialty, or location...'\n )}\n filters={\n <div className=\"flex flex-wrap items-center gap-2\">\n {/* Specialization filter */}\n <Select value={specFilter} onValueChange={setSpecFilter}>\n <SelectTrigger className=\"h-8 w-auto text-xs\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {specializations.map((s) => (\n <SelectItem key={s} value={s}>\n {specializationLabels[s] ?? s}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n\n {/* Availability filter */}\n <Select value={availFilter} onValueChange={setAvailFilter}>\n <SelectTrigger className=\"h-8 w-auto text-xs\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {availabilityOptions.map((a) => (\n <SelectItem key={a} value={a}>\n {availabilityFilterLabels[a] ?? a}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n\n {/* Sort dropdown */}\n <div ref={sortRef} className=\"relative\">\n <Button onClick={() => setShowSortDropdown((prev) => !prev)} variant=\"outline\" size=\"sm\">\n <ArrowUpDown className=\"h-3.5 w-3.5\" />\n {sortLabels[sort]}\n <ChevronDown className=\"h-3 w-3\" />\n </Button>\n {showSortDropdown && (\n <div className=\"absolute right-0 z-10 mt-1 w-44 rounded-md border border-border-subtle bg-bg-surface py-1 shadow-lg\">\n {sortOrder.map((key) => (\n <button\n key={key}\n type=\"button\"\n onClick={() => {\n setSort(key);\n setShowSortDropdown(false);\n }}\n className={cn(\n 'flex w-full items-center px-3 py-1.5 text-xs hover:bg-bg-sunken',\n sort === key ? 'font-semibold text-primary' : 'text-text-primary'\n )}\n >\n {sortLabels[key]}\n </button>\n ))}\n </div>\n )}\n </div>\n </div>\n }\n />\n\n {/* Expert Cards */}\n {filtered.length > 0 ? (\n <div className=\"grid gap-4 sm:grid-cols-2 lg:grid-cols-3\">\n {filtered.map((expert) => {\n const isExpanded = expandedExpert === expert.id;\n return (\n <div\n key={expert.id}\n className=\"rounded-lg border border-border-subtle bg-bg-surface p-5 transition-colors hover:border-primary/20\"\n >\n {/* Header */}\n <div className=\"flex items-start gap-3\">\n <div className=\"flex h-12 w-12 items-center justify-center rounded-full bg-bg-sunken text-sm font-bold text-text-primary\">\n {(expert.name ?? '')\n .split(' ')\n .map((n) => n[0])\n .join('')}\n </div>\n <div className=\"flex-1 min-w-0\">\n <h3 className=\"text-sm font-semibold text-text-primary\">{expert.name}</h3>\n <p className=\"text-xs text-text-secondary\">{expert.specialization}</p>\n </div>\n <StatusBadge\n label={availabilityDisplayLabels[expert.availability] ?? expert.availability}\n variant={availabilityVariant(expert.availability)}\n dot\n />\n </div>\n\n {/* Info */}\n <div className=\"mt-3 space-y-1.5 text-xs text-text-secondary\">\n <p className=\"flex items-center gap-1.5\">\n <Clock className=\"h-3 w-3\" />{' '}\n {t('healthybowl.network.experts.card.yearsExperience', '{{count}} years experience', {\n count: expert.experience,\n })}\n </p>\n <p className=\"flex items-center gap-1.5\">\n <MapPin className=\"h-3 w-3\" /> {expert.location}\n </p>\n <p className=\"flex items-center gap-1.5\">\n <Globe className=\"h-3 w-3\" /> {(expert.languages ?? []).join(', ')}\n </p>\n </div>\n\n {/* Rating */}\n <div className=\"mt-3 flex items-center gap-1\">\n {renderStars(expert.rating)}\n <span className=\"ml-1 text-xs font-medium text-text-primary\">{expert.rating}</span>\n <span className=\"text-xs text-text-secondary\">\n {t('healthybowl.network.experts.card.reviews', '({{count}} reviews)', { count: expert.reviews })}\n </span>\n </div>\n\n {/* Expanded Profile */}\n {isExpanded && (\n <div className=\"mt-3 rounded-md border border-border-subtle bg-bg-sunken/50 p-3\">\n <h4 className=\"text-xs font-semibold text-text-primary\">\n {t('healthybowl.network.experts.card.about', 'About')}\n </h4>\n <p className=\"mt-1 text-xs text-text-secondary\">\n {t(\n 'healthybowl.network.experts.card.aboutText',\n '{{name}} is a seasoned agricultural expert specializing in {{specialization}} with {{count}} years of field and research experience. Known for practical, evidence-based consulting that delivers measurable results.',\n {\n name: expert.name,\n specialization: (expert.specialization ?? '').toLowerCase(),\n count: expert.experience,\n }\n )}\n </p>\n <div className=\"mt-2 grid grid-cols-2 gap-2 text-xs\">\n <div className=\"rounded bg-bg-surface p-2\">\n <p className=\"font-medium text-text-primary\">\n {t('healthybowl.network.experts.card.pastConsultations', 'Past Consultations')}\n </p>\n <p className=\"text-text-secondary\">{expert.reviews * 3}+</p>\n </div>\n <div className=\"rounded bg-bg-surface p-2\">\n <p className=\"font-medium text-text-primary\">\n {t('healthybowl.network.experts.card.avgResponse', 'Avg Response')}\n </p>\n <p className=\"text-text-secondary\">\n {t('healthybowl.network.experts.card.avgResponseValue', '< 2 hours')}\n </p>\n </div>\n </div>\n </div>\n )}\n\n {/* Footer */}\n <div className=\"mt-3 flex items-center justify-between border-t border-border-subtle pt-3\">\n <span className=\"text-sm font-medium text-text-primary\">\n {t('healthybowl.network.experts.card.pricePerHour', '{{price}}/hr', {\n price: formatCurrency(expert.hourlyRate),\n })}\n </span>\n <div className=\"flex items-center gap-2\">\n <Button\n onClick={() => setExpandedExpert(isExpanded ? null : expert.id)}\n aria-label={t('healthybowl.network.experts.actions.viewProfile', 'View profile')}\n variant=\"outline\"\n size=\"icon-sm\"\n >\n <Eye className=\"h-3.5 w-3.5\" />\n </Button>\n <Button\n onClick={() => openEditExpert(expert)}\n aria-label={t('healthybowl.network.experts.actions.editExpert', 'Edit expert')}\n variant=\"outline\"\n size=\"icon-sm\"\n >\n <Pencil className=\"h-3.5 w-3.5\" />\n </Button>\n <Button\n onClick={() => handleDeleteExpert(expert)}\n disabled={deletingId === expert.id}\n aria-label={t('healthybowl.network.experts.actions.deleteExpert', 'Delete expert')}\n variant=\"ghost\"\n size=\"icon-sm\"\n className=\"text-status-error-text hover:bg-status-error-bg/10 hover:text-status-error-text\"\n >\n <Trash2 className=\"h-3.5 w-3.5\" />\n </Button>\n <Button onClick={() => openBooking(expert)} size=\"sm\">\n <CalendarCheck className=\"h-3.5 w-3.5\" />{' '}\n {t('healthybowl.network.experts.actions.bookConsultation', 'Book Consultation')}\n </Button>\n </div>\n </div>\n </div>\n );\n })}\n </div>\n ) : experts.length === 0 ? (\n loadings.network ? (\n <PageLoader />\n ) : errors.network ? (\n <ErrorState onRetry={refetch} />\n ) : (\n <EmptyState\n illustration=\"empty-people\"\n title={t('healthybowl.network.experts.emptyState.none.title', 'No experts available yet')}\n description={t(\n 'healthybowl.network.experts.emptyState.none.description',\n 'There are no agricultural experts in your network yet. Add one to get started.'\n )}\n action={\n <Button onClick={openCreateExpert}>\n <Plus className=\"h-3.5 w-3.5\" /> {t('healthybowl.network.experts.actions.addExpert', 'Add Expert')}\n </Button>\n }\n />\n )\n ) : (\n <EmptyState\n illustration=\"empty-search\"\n title={t('healthybowl.network.experts.emptyState.noMatch.title', 'No experts found')}\n description={t(\n 'healthybowl.network.experts.emptyState.noMatch.description',\n 'No experts match your current filters. Try broadening your search.'\n )}\n action={\n <Button\n onClick={() => {\n setSearch('');\n setSpecFilter('All');\n setAvailFilter('All');\n }}\n >\n {t('healthybowl.network.experts.actions.clearFilters', 'Clear Filters')}\n </Button>\n }\n />\n )}\n\n {/* My bookings */}\n {expertConsultations.length > 0 && (\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-5\">\n <h3 className=\"flex items-center gap-2 text-sm font-semibold text-text-primary\">\n <CalendarCheck className=\"h-4 w-4\" />{' '}\n {t('healthybowl.network.experts.myConsultations.heading', 'My Expert Consultations')}\n </h3>\n <ul className=\"mt-3 divide-y divide-border\">\n {expertConsultations.map((c) => (\n <li key={c.id} className=\"flex items-center justify-between gap-3 py-2.5\">\n <div className=\"min-w-0\">\n <p className=\"truncate text-sm font-medium text-text-primary\">{c.topic}</p>\n <p className=\"text-xs text-text-secondary\">\n {c.consultantName} · {formatDateOnly(c.requestedDate)} ·{' '}\n {consultationModeLabels[c.mode] ?? c.mode}\n </p>\n </div>\n <StatusBadge\n label={consultationStatusLabels[c.status] ?? c.status}\n variant={consultationStatusVariant(c.status)}\n dot\n />\n </li>\n ))}\n </ul>\n </div>\n )}\n\n {/* Booking Modal */}\n <Modal\n open={bookingExpert !== null}\n onClose={closeBooking}\n title={t('healthybowl.network.experts.bookingModal.title', 'Book Consultation')}\n description={\n bookingExpert\n ? t('healthybowl.network.experts.bookingModal.description', 'Request a session with {{name}}', {\n name: bookingExpert.name,\n })\n : undefined\n }\n footer={\n <>\n <Button onClick={closeBooking} variant=\"outline\">\n {t('healthybowl.common.cancel', 'Cancel')}\n </Button>\n <Button onClick={handleBookConsultation} disabled={submitting}>\n {submitting\n ? t('healthybowl.network.experts.bookingModal.booking', 'Booking…')\n : t('healthybowl.network.experts.bookingModal.confirm', 'Confirm Booking')}\n </Button>\n </>\n }\n >\n <div className=\"space-y-4\">\n <div>\n <label htmlFor=\"expert-booking-topic\" className=\"mb-1 block text-xs font-medium text-text-primary\">\n {t('healthybowl.network.experts.bookingModal.fields.topic.label', 'Topic')}\n </label>\n <input\n id=\"expert-booking-topic\"\n type=\"text\"\n value={bookingForm.topic}\n onChange={(e) => updateBookingForm('topic', e.target.value)}\n maxLength={200}\n placeholder={t(\n 'healthybowl.network.experts.bookingModal.fields.topic.placeholder',\n 'What would you like help with?'\n )}\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n </div>\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2\">\n <div>\n <label htmlFor=\"expert-booking-date\" className=\"mb-1 block text-xs font-medium text-text-primary\">\n {t('healthybowl.network.experts.bookingModal.fields.preferredDate.label', 'Preferred date')}\n </label>\n <input\n id=\"expert-booking-date\"\n type=\"date\"\n value={bookingForm.requestedDate}\n onChange={(e) => updateBookingForm('requestedDate', e.target.value)}\n min={todayLocalDate()}\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n </div>\n <div>\n <label htmlFor=\"expert-booking-mode\" className=\"mb-1 block text-xs font-medium text-text-primary\">\n {t('healthybowl.network.experts.bookingModal.fields.mode.label', 'Mode')}\n </label>\n <Select value={bookingForm.mode} onValueChange={(value) => updateBookingForm('mode', value)}>\n <SelectTrigger id=\"expert-booking-mode\" className=\"w-full\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {consultationModes.map((m) => (\n <SelectItem key={m.value} value={m.value}>\n {m.label}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n </div>\n <div>\n <label htmlFor=\"expert-booking-notes\" className=\"mb-1 block text-xs font-medium text-text-primary\">\n {t('healthybowl.network.experts.bookingModal.fields.notes.label', 'Notes (optional)')}\n </label>\n <textarea\n id=\"expert-booking-notes\"\n value={bookingForm.notes}\n onChange={(e) => updateBookingForm('notes', e.target.value)}\n rows={3}\n maxLength={1000}\n placeholder={t(\n 'healthybowl.network.experts.bookingModal.fields.notes.placeholder',\n 'Any additional context for the expert'\n )}\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n </div>\n {bookingExpert && (\n <p className=\"text-xs text-text-secondary\">\n {t('healthybowl.network.experts.bookingModal.estimatedFee', 'Estimated fee:')}{' '}\n <span className=\"font-medium text-text-primary\">\n {t('healthybowl.network.experts.card.pricePerHour', '{{price}}/hr', {\n price: formatCurrency(bookingExpert.hourlyRate),\n })}\n </span>\n </p>\n )}\n </div>\n </Modal>\n\n {/* Add / Edit Expert Modal */}\n <Modal\n open={showExpertModal}\n onClose={closeExpertModal}\n title={\n editingExpert\n ? t('healthybowl.network.experts.form.editTitle', 'Edit Expert')\n : t('healthybowl.network.experts.form.addTitle', 'Add Expert')\n }\n description={t('healthybowl.network.experts.form.description', 'Manage an expert in your network directory')}\n size=\"lg\"\n footer={\n <>\n <Button onClick={closeExpertModal} variant=\"outline\">\n {t('healthybowl.common.cancel', 'Cancel')}\n </Button>\n <Button onClick={handleSaveExpert} disabled={savingExpert}>\n {savingExpert\n ? t('healthybowl.network.experts.form.saving', 'Saving…')\n : t('healthybowl.network.experts.form.save', 'Save Expert')}\n </Button>\n </>\n }\n >\n <div className=\"space-y-4\">\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2\">\n <div>\n <label htmlFor=\"expert-form-name\" className=\"mb-1 block text-xs font-medium text-text-primary\">\n {t('healthybowl.network.experts.form.fields.name.label', 'Name')}\n </label>\n <input\n id=\"expert-form-name\"\n type=\"text\"\n value={expertForm.name}\n onChange={(e) => updateExpertForm('name', e.target.value)}\n maxLength={120}\n placeholder={t('healthybowl.network.experts.form.fields.name.placeholder', 'Full name')}\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n </div>\n <div>\n <label htmlFor=\"expert-form-specialization\" className=\"mb-1 block text-xs font-medium text-text-primary\">\n {t('healthybowl.network.experts.form.fields.specialization.label', 'Specialization')}\n </label>\n <input\n id=\"expert-form-specialization\"\n type=\"text\"\n value={expertForm.specialization}\n onChange={(e) => updateExpertForm('specialization', e.target.value)}\n maxLength={120}\n placeholder={t(\n 'healthybowl.network.experts.form.fields.specialization.placeholder',\n 'e.g. Soil Science & Fertility'\n )}\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n </div>\n </div>\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-3\">\n <div>\n <label htmlFor=\"expert-form-experience\" className=\"mb-1 block text-xs font-medium text-text-primary\">\n {t('healthybowl.network.experts.form.fields.experience.label', 'Experience (years)')}\n </label>\n <input\n id=\"expert-form-experience\"\n type=\"number\"\n min={0}\n value={expertForm.experience}\n onChange={(e) => updateExpertForm('experience', e.target.value)}\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n </div>\n <div>\n <label htmlFor=\"expert-form-rating\" className=\"mb-1 block text-xs font-medium text-text-primary\">\n {t('healthybowl.network.experts.form.fields.rating.label', 'Rating')}\n </label>\n <input\n id=\"expert-form-rating\"\n type=\"number\"\n min={0}\n max={5}\n step={0.1}\n value={expertForm.rating}\n onChange={(e) => updateExpertForm('rating', e.target.value)}\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n </div>\n <div>\n <label htmlFor=\"expert-form-rate\" className=\"mb-1 block text-xs font-medium text-text-primary\">\n {t('healthybowl.network.experts.form.fields.hourlyRate.label', 'Hourly rate')}\n </label>\n <input\n id=\"expert-form-rate\"\n type=\"number\"\n min={0}\n step={0.01}\n value={expertForm.hourlyRate}\n onChange={(e) => updateExpertForm('hourlyRate', e.target.value)}\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n </div>\n </div>\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2\">\n <div>\n <label htmlFor=\"expert-form-location\" className=\"mb-1 block text-xs font-medium text-text-primary\">\n {t('healthybowl.network.experts.form.fields.location.label', 'Location')}\n </label>\n <input\n id=\"expert-form-location\"\n type=\"text\"\n value={expertForm.location}\n onChange={(e) => updateExpertForm('location', e.target.value)}\n maxLength={120}\n placeholder={t('healthybowl.network.experts.form.fields.location.placeholder', 'City, Region')}\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n </div>\n <div>\n <label htmlFor=\"expert-form-availability\" className=\"mb-1 block text-xs font-medium text-text-primary\">\n {t('healthybowl.network.experts.form.fields.availability.label', 'Availability')}\n </label>\n <Select\n value={expertForm.availability}\n onValueChange={(value) => updateExpertForm('availability', value as ExpertFormState['availability'])}\n >\n <SelectTrigger id=\"expert-form-availability\" className=\"w-full\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {expertAvailabilityOptions.map((o) => (\n <SelectItem key={o.value} value={o.value}>\n {o.label}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n </div>\n <div>\n <label htmlFor=\"expert-form-languages\" className=\"mb-1 block text-xs font-medium text-text-primary\">\n {t('healthybowl.network.experts.form.fields.languages.label', 'Languages')}\n </label>\n <input\n id=\"expert-form-languages\"\n type=\"text\"\n value={expertForm.languages}\n onChange={(e) => updateExpertForm('languages', e.target.value)}\n placeholder={t('healthybowl.network.experts.form.fields.languages.placeholder', 'English, Hindi, Tamil')}\n className=\"w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]\"\n />\n <p className=\"mt-1 text-xs text-text-secondary\">\n {t('healthybowl.network.experts.form.fields.languages.hint', 'Separate multiple languages with commas')}\n </p>\n </div>\n </div>\n </Modal>\n\n <ToastContainer toasts={toasts} onDismiss={dismiss} />\n </PageLayout>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA4CA,IAAM,IAAqC;CACzC,OAAO;CACP,eAAe;CACf,MAAM;CACN,OAAO;CACR,EAaK,IAAmC;CACvC,MAAM;CACN,gBAAgB;CAChB,YAAY;CACZ,QAAQ;CACR,UAAU;CACV,cAAc;CACd,YAAY;CACZ,WAAW;CACZ,EAEK,MAA6B,MAA0B;AAC3D,SAAQ,GAAR;EACE,KAAK,YACH,QAAO;EACT,KAAK,YACH,QAAO;EACT,KAAK,YACH,QAAO;EAET,QACE,QAAO;;GAIP,KAAkB;CACtB;CACA;CACA;CACA;CACA;CACA;CACD,EACK,KAAsB;CAAC;CAAO;CAAa;CAAO,EAGlD,KAA0B;CAAC;CAAU;CAAc;CAAa;CAAa,EAE7E,MAAuB,MAAc;AACzC,SAAQ,GAAR;EACE,KAAK,YACH,QAAO;EACT,KAAK,OACH,QAAO;EACT,KAAK,UACH,QAAO;EACT,QACE,QAAO;;;AAIb,SAAS,GAAY,GAAgB;AACnC,QAAO,MAAM,KAAK,EAAE,QAAQ,GAAG,GAAG,GAAG,MACnC,kBAAC,GAAD,EAAc,WAAW,EAAG,eAAe,IAAI,KAAK,MAAM,EAAO,GAAG,8BAA8B,aAAa,EAAI,EAAxG,EAAwG,CACnH;;AAGJ,IAAa,UAAwB;CACnC,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