@burdenoff/microfe-healthybowl 2026.1005.2 → 2026.1007.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/components/BedLayoutGrid.js +128 -115
- package/dist/healthybowl/components/BedLayoutGrid.js.map +1 -1
- package/dist/healthybowl/components/CropPicker.js +37 -0
- package/dist/healthybowl/components/CropPicker.js.map +1 -0
- package/dist/healthybowl/components/DataTable.js +125 -108
- package/dist/healthybowl/components/DataTable.js.map +1 -1
- package/dist/healthybowl/components/FilterBar.js +9 -6
- package/dist/healthybowl/components/FilterBar.js.map +1 -1
- package/dist/healthybowl/components/PlantCatalogPicker.js +32 -0
- package/dist/healthybowl/components/PlantCatalogPicker.js.map +1 -0
- package/dist/healthybowl/components/WorkspaceRecordPicker.js +164 -0
- package/dist/healthybowl/components/WorkspaceRecordPicker.js.map +1 -0
- package/dist/healthybowl/components/index.js +3 -1
- package/dist/healthybowl/hooks/useCropPage.js +71 -0
- package/dist/healthybowl/hooks/useCropPage.js.map +1 -0
- package/dist/healthybowl/hooks/usePlantCatalog.js +133 -44
- package/dist/healthybowl/hooks/usePlantCatalog.js.map +1 -1
- package/dist/healthybowl/hooks/usePlantingEstimate.js +6 -6
- package/dist/healthybowl/hooks/usePlantingEstimate.js.map +1 -1
- package/dist/healthybowl/hooks/useWorkspaceRead.js +46 -0
- package/dist/healthybowl/hooks/useWorkspaceRead.js.map +1 -0
- package/dist/healthybowl/pages/HomePage.js +143 -142
- package/dist/healthybowl/pages/HomePage.js.map +1 -1
- package/dist/healthybowl/pages/analytics/ReportsPage.js +8 -8
- package/dist/healthybowl/pages/catalog/PlantCatalogPage.js +266 -192
- package/dist/healthybowl/pages/catalog/PlantCatalogPage.js.map +1 -1
- package/dist/healthybowl/pages/catalog/WorkspaceBrowseFilters.js +58 -0
- package/dist/healthybowl/pages/catalog/WorkspaceBrowseFilters.js.map +1 -0
- package/dist/healthybowl/pages/catalog/browsePagination.js +24 -0
- package/dist/healthybowl/pages/catalog/browsePagination.js.map +1 -0
- package/dist/healthybowl/pages/compliance/ComplianceDocumentsPage.js +6 -6
- package/dist/healthybowl/pages/crops/CropDetailsPage.js +340 -348
- package/dist/healthybowl/pages/crops/CropDetailsPage.js.map +1 -1
- package/dist/healthybowl/pages/crops/CropPlanningPage.js +468 -434
- package/dist/healthybowl/pages/crops/CropPlanningPage.js.map +1 -1
- package/dist/healthybowl/pages/crops/CropsPage.js +633 -542
- package/dist/healthybowl/pages/crops/CropsPage.js.map +1 -1
- package/dist/healthybowl/pages/crops/FieldDetailsPage.js +875 -800
- package/dist/healthybowl/pages/crops/FieldDetailsPage.js.map +1 -1
- package/dist/healthybowl/pages/crops/PlanningDetailsPage.js +459 -448
- package/dist/healthybowl/pages/crops/PlanningDetailsPage.js.map +1 -1
- package/dist/healthybowl/pages/crops/SuccessionCropLabel.js +21 -0
- package/dist/healthybowl/pages/crops/SuccessionCropLabel.js.map +1 -0
- package/dist/healthybowl/pages/crops/planningEdit.js +30 -0
- package/dist/healthybowl/pages/crops/planningEdit.js.map +1 -0
- package/dist/healthybowl/pages/fields/FieldMapPage.js +989 -941
- package/dist/healthybowl/pages/fields/FieldMapPage.js.map +1 -1
- package/dist/healthybowl/pages/financial/GeneralLedgerPage.js +6 -6
- package/dist/healthybowl/pages/financial/InvoiceManagementPage.js +7 -7
- package/dist/healthybowl/pages/financial/InvoiceManagementPage.js.map +1 -1
- package/dist/healthybowl/pages/financial/TransactionsPage.js +541 -541
- package/dist/healthybowl/pages/financial/TransactionsPage.js.map +1 -1
- package/dist/healthybowl/pages/government-schemes/ApplicationTrackingPage.js +10 -10
- package/dist/healthybowl/pages/government-schemes/CommunicationPage.js +207 -207
- package/dist/healthybowl/pages/government-schemes/CommunicationPage.js.map +1 -1
- package/dist/healthybowl/pages/government-schemes/SchemeAdminPage.js +38 -38
- package/dist/healthybowl/pages/government-schemes/SchemeAdminPage.js.map +1 -1
- package/dist/healthybowl/pages/government-schemes/TrainingProgramsPage.js +15 -15
- package/dist/healthybowl/pages/government-schemes/TrainingProgramsPage.js.map +1 -1
- package/dist/healthybowl/pages/livestock/AnimalRegistryPage.js +4 -4
- package/dist/healthybowl/pages/livestock/BreedingManagementPage.js +4 -4
- package/dist/healthybowl/pages/livestock/FeedManagementPage.js +4 -4
- package/dist/healthybowl/pages/livestock/HealthRecordsPage.js +16 -16
- package/dist/healthybowl/pages/livestock/HealthRecordsPage.js.map +1 -1
- package/dist/healthybowl/pages/livestock/ProductionTrackingPage.js +4 -4
- package/dist/healthybowl/pages/livestock/VaccinationSchedulePage.js +4 -4
- package/dist/healthybowl/pages/market/MarketPricesPage.js +305 -305
- package/dist/healthybowl/pages/market/MarketPricesPage.js.map +1 -1
- package/dist/healthybowl/pages/network/CohortsPage.js +107 -107
- package/dist/healthybowl/pages/network/CohortsPage.js.map +1 -1
- package/dist/healthybowl/pages/network/CommunityPage.js +247 -247
- package/dist/healthybowl/pages/network/CommunityPage.js.map +1 -1
- package/dist/healthybowl/pages/network/EventsPage.js +16 -16
- package/dist/healthybowl/pages/network/EventsPage.js.map +1 -1
- package/dist/healthybowl/pages/network/ExpertsPage.js +470 -470
- package/dist/healthybowl/pages/network/ExpertsPage.js.map +1 -1
- package/dist/healthybowl/pages/network/MentorsPage.js +6 -6
- package/dist/healthybowl/pages/pest-management/PestIssuesPage.js +8 -8
- package/dist/healthybowl/pages/pest-management/TreatmentLibraryPage.js +7 -7
- package/dist/healthybowl/pages/pest-management/TreatmentLibraryPage.js.map +1 -1
- package/dist/healthybowl/pages/production/ProductionBatchesPage.js +7 -7
- package/dist/healthybowl/pages/production/RecipeManagementPage.js +5 -5
- package/dist/healthybowl/pages/production/ValueAddedProductsPage.js +7 -7
- package/dist/healthybowl/pages/soil/SoilTestsPage.js +6 -6
- package/dist/healthybowl/pages/soil/SoilTestsPage.js.map +1 -1
- package/dist/healthybowl/pages/suppliers/SuppliersPage.js +10 -10
- package/dist/healthybowl/pages/sustainability/CarbonCreditLedgerPage.js +6 -6
- package/dist/healthybowl/pages/terrace/PlantingFormModal.js +151 -131
- package/dist/healthybowl/pages/terrace/PlantingFormModal.js.map +1 -1
- package/dist/healthybowl/pages/traceability/BatchTrackingPage.js +6 -6
- package/dist/healthybowl/utils/cropComparison.js +1 -1
- package/dist/healthybowl/utils/cropComparison.js.map +1 -1
- package/dist/healthybowl/utils/cropPicker.js +35 -0
- package/dist/healthybowl/utils/cropPicker.js.map +1 -0
- package/dist/healthybowl/utils/plantingCapacity.js +2 -2
- package/dist/healthybowl/utils/plantingCapacity.js.map +1 -1
- package/dist/healthybowl/utils/quotaLabels.js +8 -0
- package/dist/healthybowl/utils/quotaLabels.js.map +1 -0
- package/dist/healthybowl/utils/seedRate.js +1 -8
- package/dist/healthybowl/utils/seedRate.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,26 +2,26 @@ import { useHealthyBowl as e } from "../../context/HealthyBowlContext.js";
|
|
|
2
2
|
import { cn as t, formatDate as n } from "../../utils/helpers.js";
|
|
3
3
|
import { PageLayout as r } from "../../components/PageLayout.js";
|
|
4
4
|
import { StatCard as i } from "../../components/StatCard.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { FilterBar as a } from "../../components/FilterBar.js";
|
|
6
|
+
import { StatusBadge as o } from "../../components/StatusBadge.js";
|
|
7
|
+
import { EmptyState as s } from "../../components/EmptyState.js";
|
|
7
8
|
import { ErrorState as ee } from "../../components/ErrorState.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { useToast as le } from "../../hooks/useToast.js";
|
|
9
|
+
import { ToastContainer as te } from "../../components/Toast.js";
|
|
10
|
+
import { PageLoader as ne } from "../../components/PageLoader.js";
|
|
11
|
+
import { Modal as c } from "../../components/Modal.js";
|
|
12
|
+
import { useAddHealthyBowlCommunityReactionMutation as re, useCreateHealthyBowlCommunityChannelMutation as ie, useGetHealthyBowlCommunityChannelsQuery as ae, useGetHealthyBowlCommunityMessagesQuery as oe, useGetHealthyBowlCommunityThreadQuery as l, useSendHealthyBowlCommunityMessageMutation as se } from "../../../generated/wspace-operations.js";
|
|
13
|
+
import { useToast as ce } from "../../hooks/useToast.js";
|
|
14
14
|
import "../../components/index.js";
|
|
15
|
-
import { ConversationType as
|
|
16
|
-
import { useCallback as
|
|
17
|
-
import { useI18n as
|
|
18
|
-
import { ArrowUpDown as
|
|
19
|
-
import { Fragment as
|
|
20
|
-
import { Button as
|
|
15
|
+
import { ConversationType as le } from "../../../generated/wspace-types.js";
|
|
16
|
+
import { useCallback as u, useEffect as ue, useMemo as d, useRef as de, useState as f } from "react";
|
|
17
|
+
import { useI18n as p } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
18
|
+
import { ArrowUpDown as fe, ChevronDown as pe, Eye as me, Heart as m, MessageCircle as he, MessageSquare as h, Plus as g, Tag as _, TrendingUp as ge } from "lucide-react";
|
|
19
|
+
import { Fragment as _e, jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
20
|
+
import { Button as b, Select as ve, SelectContent as ye, SelectItem as be, SelectTrigger as xe, SelectValue as Se } from "@burdenoff/fe-libs/ui";
|
|
21
21
|
//#region src/healthybowl/pages/network/CommunityPage.tsx
|
|
22
|
-
var
|
|
22
|
+
var x = "HealthyBowl Community", Ce = "👍", S = (e) => typeof e == "string" ? e : "";
|
|
23
23
|
function we(e, t, n) {
|
|
24
|
-
let r = e.content ?? {}, i = r.payload ?? {}, a = e.reactions.filter((e) => e.emoji ===
|
|
24
|
+
let r = e.content ?? {}, i = r.payload ?? {}, a = e.reactions.filter((e) => e.emoji === Ce);
|
|
25
25
|
return {
|
|
26
26
|
id: e.id,
|
|
27
27
|
title: S(i.title) || S(r.text).slice(0, 60) || "Untitled",
|
|
@@ -37,75 +37,75 @@ function we(e, t, n) {
|
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
39
|
var C = () => {
|
|
40
|
-
let { t:
|
|
40
|
+
let { t: l } = p(), { workspaceId: S, currentUser: C } = e(), w = C?.id ?? "", T = C ? [C.firstName, C.lastName].filter(Boolean).join(" ") || C.email : "", { data: E, loading: Ee, error: De, refetch: D } = ae({
|
|
41
41
|
variables: { first: 100 },
|
|
42
42
|
fetchPolicy: "cache-and-network"
|
|
43
|
-
}), O =
|
|
43
|
+
}), O = d(() => {
|
|
44
44
|
let e = E?.conversations.edges ?? [];
|
|
45
|
-
return (e.find((e) => (e.node.title ?? "") ===
|
|
46
|
-
}, [E, S]), { data: k, loading: Oe, error: ke, refetch: A } =
|
|
45
|
+
return (e.find((e) => (e.node.title ?? "") === x && e.node.workspaceId === S) ?? e.find((e) => (e.node.title ?? "") === x))?.node.id ?? null;
|
|
46
|
+
}, [E, S]), { data: k, loading: Oe, error: ke, refetch: A } = oe({
|
|
47
47
|
variables: {
|
|
48
48
|
conversationId: O ?? "",
|
|
49
49
|
first: 100
|
|
50
50
|
},
|
|
51
51
|
skip: !O,
|
|
52
52
|
fetchPolicy: "cache-and-network"
|
|
53
|
-
}), [
|
|
53
|
+
}), [j] = ie(), [M] = se(), [Ae] = re(), je = u(async () => {
|
|
54
54
|
await D(), O && await A();
|
|
55
55
|
}, [
|
|
56
56
|
D,
|
|
57
57
|
A,
|
|
58
58
|
O
|
|
59
|
-
]),
|
|
59
|
+
]), N = d(() => (k?.conversation?.messages.edges ?? []).map((e) => e.node).filter((e) => !e.parentMessageId).map((e) => we(e, w, l("healthybowl.network.community.author.unknown", "Community member"))), [
|
|
60
60
|
k,
|
|
61
61
|
w,
|
|
62
|
-
|
|
63
|
-
]),
|
|
62
|
+
l
|
|
63
|
+
]), Me = Ee || !!O && Oe, Ne = De ?? ke, Pe = [
|
|
64
64
|
"All",
|
|
65
65
|
"Soil Health",
|
|
66
66
|
"Pest Management",
|
|
67
67
|
"Irrigation",
|
|
68
68
|
"Livestock",
|
|
69
69
|
"General"
|
|
70
|
-
],
|
|
71
|
-
All:
|
|
72
|
-
"Soil Health":
|
|
73
|
-
"Pest Management":
|
|
74
|
-
Irrigation:
|
|
75
|
-
Livestock:
|
|
76
|
-
General:
|
|
77
|
-
},
|
|
78
|
-
recent:
|
|
79
|
-
likes:
|
|
80
|
-
replies:
|
|
81
|
-
}, [
|
|
82
|
-
|
|
70
|
+
], P = {
|
|
71
|
+
All: l("healthybowl.common.all", "All"),
|
|
72
|
+
"Soil Health": l("healthybowl.network.community.categories.soilHealth", "Soil Health"),
|
|
73
|
+
"Pest Management": l("healthybowl.network.community.categories.pestManagement", "Pest Management"),
|
|
74
|
+
Irrigation: l("healthybowl.network.community.categories.irrigation", "Irrigation"),
|
|
75
|
+
Livestock: l("healthybowl.network.community.categories.livestock", "Livestock"),
|
|
76
|
+
General: l("healthybowl.network.community.categories.general", "General")
|
|
77
|
+
}, F = {
|
|
78
|
+
recent: l("healthybowl.network.community.sort.recent", "Most Recent"),
|
|
79
|
+
likes: l("healthybowl.network.community.sort.likes", "Most Liked"),
|
|
80
|
+
replies: l("healthybowl.network.community.sort.replies", "Most Replies")
|
|
81
|
+
}, [I, L] = f(""), [R, z] = f("All"), [B, Fe] = f("recent"), [Ie, V] = f(!1), [Le, Re] = f(null), [H, U] = f(null), [ze, W] = f(!1), [G, K] = f(""), [q, J] = f("General"), [Y, Be] = f(""), [Ve, He] = f(""), [Ue, We] = f(!1), [Ge, Ke] = f(null), [X, Z] = f(""), [qe, Je] = f(!1), Q = de(null), { toasts: Ye, toast: $, dismiss: Xe } = ce();
|
|
82
|
+
ue(() => {
|
|
83
83
|
let e = (e) => {
|
|
84
|
-
Q.current && !Q.current.contains(e.target) &&
|
|
84
|
+
Q.current && !Q.current.contains(e.target) && V(!1);
|
|
85
85
|
};
|
|
86
86
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
87
87
|
}, []);
|
|
88
|
-
let Ze =
|
|
89
|
-
let t = e.title.toLowerCase().includes(
|
|
88
|
+
let Ze = d(() => N.filter((e) => {
|
|
89
|
+
let t = e.title.toLowerCase().includes(I.toLowerCase()) || e.author.toLowerCase().includes(I.toLowerCase()) || e.content.toLowerCase().includes(I.toLowerCase()) || e.tags.some((e) => e.toLowerCase().includes(I.toLowerCase())), n = R === "All" || e.category === R;
|
|
90
90
|
return t && n;
|
|
91
91
|
}).sort((e, t) => {
|
|
92
|
-
switch (
|
|
92
|
+
switch (B) {
|
|
93
93
|
case "recent": return new Date(t.createdAt).getTime() - new Date(e.createdAt).getTime();
|
|
94
94
|
case "likes": return t.likes - e.likes;
|
|
95
95
|
case "replies": return t.replies - e.replies;
|
|
96
96
|
default: return 0;
|
|
97
97
|
}
|
|
98
98
|
}), [
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
]), Qe =
|
|
99
|
+
N,
|
|
100
|
+
I,
|
|
101
|
+
R,
|
|
102
|
+
B
|
|
103
|
+
]), Qe = N.reduce((e, t) => e + t.replies, 0), $e = N.filter((e) => e.replies > 10).length, et = N.reduce((e, t) => e + t.likes, 0), tt = u(async () => {
|
|
104
104
|
if (O) return O;
|
|
105
|
-
let e = (await
|
|
106
|
-
title:
|
|
107
|
-
description:
|
|
108
|
-
type:
|
|
105
|
+
let e = (await j({ variables: { input: {
|
|
106
|
+
title: x,
|
|
107
|
+
description: l("healthybowl.network.community.channelDescription", "Discussions with fellow farmers and experts"),
|
|
108
|
+
type: le.Channel,
|
|
109
109
|
workspaceId: S,
|
|
110
110
|
participantIds: w ? [w] : []
|
|
111
111
|
} } })).data?.createConversation.conversation?.id;
|
|
@@ -113,21 +113,21 @@ var C = () => {
|
|
|
113
113
|
return await D(), e;
|
|
114
114
|
}, [
|
|
115
115
|
O,
|
|
116
|
-
|
|
116
|
+
j,
|
|
117
117
|
D,
|
|
118
|
-
|
|
118
|
+
l,
|
|
119
119
|
S,
|
|
120
120
|
w
|
|
121
|
-
]), nt =
|
|
121
|
+
]), nt = u(async (e) => {
|
|
122
122
|
Ke(e.id);
|
|
123
123
|
try {
|
|
124
|
-
await
|
|
124
|
+
await Ae({ variables: {
|
|
125
125
|
messageId: e.id,
|
|
126
|
-
emoji:
|
|
126
|
+
emoji: Ce
|
|
127
127
|
} }), await A();
|
|
128
128
|
} catch (e) {
|
|
129
129
|
$({
|
|
130
|
-
title:
|
|
130
|
+
title: l("healthybowl.network.community.toast.likeFailed.title", "Could not like post"),
|
|
131
131
|
description: e instanceof Error ? e.message : String(e),
|
|
132
132
|
variant: "error"
|
|
133
133
|
});
|
|
@@ -135,17 +135,17 @@ var C = () => {
|
|
|
135
135
|
Ke(null);
|
|
136
136
|
}
|
|
137
137
|
}, [
|
|
138
|
-
|
|
138
|
+
Ae,
|
|
139
139
|
A,
|
|
140
140
|
$,
|
|
141
|
-
|
|
141
|
+
l
|
|
142
142
|
]), rt = (e) => {
|
|
143
|
-
Z(""),
|
|
143
|
+
Z(""), U(e);
|
|
144
144
|
}, it = async () => {
|
|
145
|
-
if (!
|
|
145
|
+
if (!G.trim() || !Y.trim()) {
|
|
146
146
|
$({
|
|
147
|
-
title:
|
|
148
|
-
description:
|
|
147
|
+
title: l("healthybowl.network.community.toast.missingFields.title", "Missing Fields"),
|
|
148
|
+
description: l("healthybowl.network.community.toast.missingFields.description", "Please fill in title and content"),
|
|
149
149
|
variant: "warning"
|
|
150
150
|
});
|
|
151
151
|
return;
|
|
@@ -153,49 +153,49 @@ var C = () => {
|
|
|
153
153
|
We(!0);
|
|
154
154
|
try {
|
|
155
155
|
let e = await tt(), t = Ve.split(",").map((e) => e.trim()).filter(Boolean);
|
|
156
|
-
await
|
|
156
|
+
await M({ variables: { input: {
|
|
157
157
|
conversationId: e,
|
|
158
158
|
content: {
|
|
159
|
-
text:
|
|
159
|
+
text: Y.trim(),
|
|
160
160
|
payload: {
|
|
161
|
-
title:
|
|
162
|
-
category:
|
|
161
|
+
title: G.trim(),
|
|
162
|
+
category: q,
|
|
163
163
|
tags: t,
|
|
164
164
|
author: T
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
} } }), $({
|
|
168
|
-
title:
|
|
169
|
-
description:
|
|
168
|
+
title: l("healthybowl.network.community.toast.postCreated.title", "Post Created!"),
|
|
169
|
+
description: l("healthybowl.network.community.toast.postCreated.description", "\"{{title}}\" has been published", { title: G }),
|
|
170
170
|
variant: "success"
|
|
171
|
-
}),
|
|
171
|
+
}), W(!1), K(""), J("General"), Be(""), He(""), await je();
|
|
172
172
|
} catch (e) {
|
|
173
173
|
$({
|
|
174
|
-
title:
|
|
175
|
-
description: e instanceof Error ? e.message :
|
|
174
|
+
title: l("healthybowl.common.error", "Error"),
|
|
175
|
+
description: e instanceof Error ? e.message : l("healthybowl.network.community.toast.createFailed.description", "Failed to create post"),
|
|
176
176
|
variant: "error"
|
|
177
177
|
});
|
|
178
178
|
} finally {
|
|
179
179
|
We(!1);
|
|
180
180
|
}
|
|
181
181
|
}, at = async () => {
|
|
182
|
-
if (!(!
|
|
182
|
+
if (!(!H || !X.trim() || !O)) {
|
|
183
183
|
Je(!0);
|
|
184
184
|
try {
|
|
185
|
-
await
|
|
185
|
+
await M({ variables: { input: {
|
|
186
186
|
conversationId: O,
|
|
187
|
-
parentMessageId:
|
|
187
|
+
parentMessageId: H.id,
|
|
188
188
|
content: {
|
|
189
189
|
text: X.trim(),
|
|
190
190
|
payload: { author: T }
|
|
191
191
|
}
|
|
192
192
|
} } }), Z(""), await A(), $({
|
|
193
|
-
title:
|
|
193
|
+
title: l("healthybowl.network.community.toast.replyPosted.title", "Reply posted"),
|
|
194
194
|
variant: "success"
|
|
195
195
|
});
|
|
196
196
|
} catch (e) {
|
|
197
197
|
$({
|
|
198
|
-
title:
|
|
198
|
+
title: l("healthybowl.network.community.toast.replyFailed.title", "Could not post reply"),
|
|
199
199
|
description: e instanceof Error ? e.message : String(e),
|
|
200
200
|
variant: "error"
|
|
201
201
|
});
|
|
@@ -205,168 +205,168 @@ var C = () => {
|
|
|
205
205
|
}
|
|
206
206
|
}, ot = (e) => {
|
|
207
207
|
let t = Math.floor((Date.now() - new Date(e).getTime()) / (1e3 * 60 * 60 * 24));
|
|
208
|
-
return t === 0 ?
|
|
208
|
+
return t === 0 ? l("healthybowl.network.community.time.today", "Today") : t === 1 ? l("healthybowl.network.community.time.yesterday", "Yesterday") : t < 7 ? l("healthybowl.network.community.time.daysAgo", "{{count}} days ago", { count: t }) : n(e);
|
|
209
209
|
};
|
|
210
|
-
return /* @__PURE__ */
|
|
211
|
-
title:
|
|
212
|
-
description:
|
|
210
|
+
return /* @__PURE__ */ y(r, {
|
|
211
|
+
title: l("healthybowl.network.community.title", "Community"),
|
|
212
|
+
description: l("healthybowl.network.community.description", "Join discussions with fellow farmers and experts"),
|
|
213
213
|
purpose: "Swap ideas, ask questions and share what's working with other farmers and experts. Farming is easier when you're not doing it alone — this is the place to learn from people who've faced the same challenges.",
|
|
214
214
|
children: [
|
|
215
|
-
/* @__PURE__ */
|
|
215
|
+
/* @__PURE__ */ y("div", {
|
|
216
216
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
|
|
217
217
|
children: [
|
|
218
|
-
/* @__PURE__ */
|
|
218
|
+
/* @__PURE__ */ v(i, {
|
|
219
219
|
hero: !0,
|
|
220
|
-
label:
|
|
221
|
-
value:
|
|
222
|
-
icon: /* @__PURE__ */
|
|
220
|
+
label: l("healthybowl.network.community.stats.totalPosts", "Total Posts"),
|
|
221
|
+
value: N.length,
|
|
222
|
+
icon: /* @__PURE__ */ v(he, { className: "h-4 w-4" })
|
|
223
223
|
}),
|
|
224
|
-
/* @__PURE__ */
|
|
225
|
-
label:
|
|
224
|
+
/* @__PURE__ */ v(i, {
|
|
225
|
+
label: l("healthybowl.network.community.stats.totalReplies", "Total Replies"),
|
|
226
226
|
value: Qe,
|
|
227
|
-
icon: /* @__PURE__ */
|
|
227
|
+
icon: /* @__PURE__ */ v(h, { className: "h-4 w-4" })
|
|
228
228
|
}),
|
|
229
|
-
/* @__PURE__ */
|
|
230
|
-
label:
|
|
229
|
+
/* @__PURE__ */ v(i, {
|
|
230
|
+
label: l("healthybowl.network.community.stats.activeDiscussions", "Active Discussions"),
|
|
231
231
|
value: $e,
|
|
232
|
-
icon: /* @__PURE__ */
|
|
232
|
+
icon: /* @__PURE__ */ v(ge, { className: "h-4 w-4" })
|
|
233
233
|
}),
|
|
234
|
-
/* @__PURE__ */
|
|
235
|
-
label:
|
|
234
|
+
/* @__PURE__ */ v(i, {
|
|
235
|
+
label: l("healthybowl.network.community.stats.totalLikes", "Total Likes"),
|
|
236
236
|
value: et,
|
|
237
|
-
icon: /* @__PURE__ */
|
|
237
|
+
icon: /* @__PURE__ */ v(m, { className: "h-4 w-4" })
|
|
238
238
|
})
|
|
239
239
|
]
|
|
240
240
|
}),
|
|
241
|
-
/* @__PURE__ */
|
|
241
|
+
/* @__PURE__ */ v("div", {
|
|
242
242
|
className: "flex flex-wrap items-center gap-1.5 border-b border-border-subtle pb-3",
|
|
243
|
-
children:
|
|
243
|
+
children: Pe.map((e) => /* @__PURE__ */ v("button", {
|
|
244
244
|
type: "button",
|
|
245
|
-
onClick: () =>
|
|
246
|
-
className: t("rounded-full px-3 py-1.5 text-xs font-medium transition-colors",
|
|
247
|
-
children:
|
|
245
|
+
onClick: () => z(e),
|
|
246
|
+
className: t("rounded-full px-3 py-1.5 text-xs font-medium transition-colors", R === e ? "bg-action-primary-bg text-action-primary-text" : "bg-bg-sunken text-text-secondary hover:bg-bg-sunken/80 hover:text-text-primary"),
|
|
247
|
+
children: P[e] ?? e
|
|
248
248
|
}, e))
|
|
249
249
|
}),
|
|
250
|
-
/* @__PURE__ */
|
|
251
|
-
searchValue:
|
|
252
|
-
onSearchChange:
|
|
253
|
-
searchPlaceholder:
|
|
254
|
-
filters: /* @__PURE__ */
|
|
250
|
+
/* @__PURE__ */ v(a, {
|
|
251
|
+
searchValue: I,
|
|
252
|
+
onSearchChange: L,
|
|
253
|
+
searchPlaceholder: l("healthybowl.network.community.searchPlaceholder", "Search posts, authors, or tags..."),
|
|
254
|
+
filters: /* @__PURE__ */ y("div", {
|
|
255
255
|
ref: Q,
|
|
256
256
|
className: "relative",
|
|
257
|
-
children: [/* @__PURE__ */
|
|
257
|
+
children: [/* @__PURE__ */ y(b, {
|
|
258
258
|
variant: "outline",
|
|
259
259
|
size: "sm",
|
|
260
|
-
onClick: () =>
|
|
260
|
+
onClick: () => V((e) => !e),
|
|
261
261
|
className: "w-auto",
|
|
262
262
|
children: [
|
|
263
|
-
/* @__PURE__ */
|
|
264
|
-
|
|
265
|
-
/* @__PURE__ */
|
|
263
|
+
/* @__PURE__ */ v(fe, { className: "h-3.5 w-3.5" }),
|
|
264
|
+
F[B],
|
|
265
|
+
/* @__PURE__ */ v(pe, { className: "h-3 w-3" })
|
|
266
266
|
]
|
|
267
|
-
}),
|
|
267
|
+
}), Ie && /* @__PURE__ */ v("div", {
|
|
268
268
|
className: "absolute end-0 z-10 mt-1 w-40 rounded-md border border-border-subtle bg-bg-surface py-1 shadow-lg",
|
|
269
|
-
children: Object.keys(
|
|
269
|
+
children: Object.keys(F).map((e) => /* @__PURE__ */ v(b, {
|
|
270
270
|
variant: "ghost",
|
|
271
271
|
size: "sm",
|
|
272
272
|
onClick: () => {
|
|
273
|
-
|
|
273
|
+
Fe(e), V(!1);
|
|
274
274
|
},
|
|
275
|
-
className: t("w-full justify-start",
|
|
276
|
-
children:
|
|
275
|
+
className: t("w-full justify-start", B === e ? "font-semibold text-primary" : "text-text-primary"),
|
|
276
|
+
children: F[e]
|
|
277
277
|
}, e))
|
|
278
278
|
})]
|
|
279
279
|
}),
|
|
280
|
-
actions: /* @__PURE__ */
|
|
280
|
+
actions: /* @__PURE__ */ y(b, {
|
|
281
281
|
size: "sm",
|
|
282
|
-
onClick: () =>
|
|
282
|
+
onClick: () => W(!0),
|
|
283
283
|
children: [
|
|
284
|
-
/* @__PURE__ */
|
|
284
|
+
/* @__PURE__ */ v(g, { className: "h-3.5 w-3.5" }),
|
|
285
285
|
" ",
|
|
286
|
-
|
|
286
|
+
l("healthybowl.network.community.actions.newPost", "New Post")
|
|
287
287
|
]
|
|
288
288
|
})
|
|
289
289
|
}),
|
|
290
|
-
Ze.length > 0 ? /* @__PURE__ */
|
|
290
|
+
Ze.length > 0 ? /* @__PURE__ */ v("div", {
|
|
291
291
|
className: "space-y-4",
|
|
292
292
|
children: Ze.map((e) => {
|
|
293
|
-
let n =
|
|
294
|
-
return /* @__PURE__ */
|
|
293
|
+
let n = Le === e.id;
|
|
294
|
+
return /* @__PURE__ */ y("div", {
|
|
295
295
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-5 transition-colors hover:border-primary/20",
|
|
296
296
|
children: [
|
|
297
|
-
/* @__PURE__ */
|
|
297
|
+
/* @__PURE__ */ y("div", {
|
|
298
298
|
className: "flex items-center gap-2",
|
|
299
299
|
children: [
|
|
300
|
-
/* @__PURE__ */
|
|
300
|
+
/* @__PURE__ */ v("div", {
|
|
301
301
|
className: "flex h-8 w-8 items-center justify-center rounded-full bg-bg-sunken text-xs font-semibold text-text-primary",
|
|
302
302
|
children: e.author.split(" ").map((e) => e[0]).join("")
|
|
303
303
|
}),
|
|
304
|
-
/* @__PURE__ */
|
|
304
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("span", {
|
|
305
305
|
className: "text-sm font-medium text-text-primary",
|
|
306
306
|
children: e.author
|
|
307
|
-
}), /* @__PURE__ */
|
|
307
|
+
}), /* @__PURE__ */ v(o, {
|
|
308
308
|
label: e.authorRole,
|
|
309
309
|
variant: "muted",
|
|
310
310
|
className: "ms-2"
|
|
311
311
|
})] }),
|
|
312
|
-
/* @__PURE__ */
|
|
312
|
+
/* @__PURE__ */ v("span", {
|
|
313
313
|
className: "ms-auto text-xs text-text-secondary",
|
|
314
314
|
children: ot(e.createdAt)
|
|
315
315
|
})
|
|
316
316
|
]
|
|
317
317
|
}),
|
|
318
|
-
/* @__PURE__ */
|
|
318
|
+
/* @__PURE__ */ v("h3", {
|
|
319
319
|
className: "mt-3 cursor-pointer text-sm font-semibold text-text-primary hover:text-primary",
|
|
320
|
-
onClick: () =>
|
|
320
|
+
onClick: () => Re(n ? null : e.id),
|
|
321
321
|
children: e.title
|
|
322
322
|
}),
|
|
323
|
-
/* @__PURE__ */
|
|
323
|
+
/* @__PURE__ */ v("p", {
|
|
324
324
|
className: t("mt-1 text-sm text-text-secondary", !n && "line-clamp-2"),
|
|
325
325
|
children: e.content
|
|
326
326
|
}),
|
|
327
|
-
/* @__PURE__ */
|
|
327
|
+
/* @__PURE__ */ y("div", {
|
|
328
328
|
className: "mt-3 flex flex-wrap items-center gap-2",
|
|
329
|
-
children: [/* @__PURE__ */
|
|
329
|
+
children: [/* @__PURE__ */ v(o, {
|
|
330
330
|
label: e.category,
|
|
331
331
|
variant: "default"
|
|
332
|
-
}), e.tags.map((e) => /* @__PURE__ */
|
|
332
|
+
}), e.tags.map((e) => /* @__PURE__ */ y("span", {
|
|
333
333
|
className: "flex items-center gap-1 rounded-full bg-bg-sunken px-2 py-0.5 text-xs text-text-secondary",
|
|
334
334
|
children: [
|
|
335
|
-
/* @__PURE__ */ _
|
|
335
|
+
/* @__PURE__ */ v(_, { className: "h-2.5 w-2.5" }),
|
|
336
336
|
" ",
|
|
337
337
|
e
|
|
338
338
|
]
|
|
339
339
|
}, e))]
|
|
340
340
|
}),
|
|
341
|
-
/* @__PURE__ */
|
|
341
|
+
/* @__PURE__ */ y("div", {
|
|
342
342
|
className: "mt-3 flex items-center gap-4",
|
|
343
343
|
children: [
|
|
344
|
-
/* @__PURE__ */
|
|
344
|
+
/* @__PURE__ */ y(b, {
|
|
345
345
|
variant: "ghost",
|
|
346
346
|
size: "sm",
|
|
347
347
|
onClick: () => void nt(e),
|
|
348
348
|
disabled: Ge === e.id,
|
|
349
|
-
title:
|
|
349
|
+
title: l("healthybowl.network.community.post.like", "Like this post"),
|
|
350
350
|
className: t("gap-1", e.likedByMe ? "text-primary" : "text-text-secondary"),
|
|
351
|
-
children: [/* @__PURE__ */
|
|
351
|
+
children: [/* @__PURE__ */ v(m, { className: t("h-3.5 w-3.5", e.likedByMe && "fill-current") }), e.likes]
|
|
352
352
|
}),
|
|
353
|
-
/* @__PURE__ */
|
|
353
|
+
/* @__PURE__ */ y("span", {
|
|
354
354
|
className: "flex items-center gap-1 text-xs text-text-secondary",
|
|
355
355
|
children: [
|
|
356
|
-
/* @__PURE__ */
|
|
356
|
+
/* @__PURE__ */ v(h, { className: "h-3.5 w-3.5" }),
|
|
357
357
|
" ",
|
|
358
|
-
|
|
358
|
+
l("healthybowl.network.community.post.replies", "{{count}} replies", { count: e.replies })
|
|
359
359
|
]
|
|
360
360
|
}),
|
|
361
|
-
/* @__PURE__ */
|
|
361
|
+
/* @__PURE__ */ y(b, {
|
|
362
362
|
variant: "ghost",
|
|
363
363
|
size: "sm",
|
|
364
364
|
onClick: () => rt(e),
|
|
365
365
|
className: "ms-auto gap-1 font-medium text-primary",
|
|
366
366
|
children: [
|
|
367
|
-
/* @__PURE__ */
|
|
367
|
+
/* @__PURE__ */ v(me, { className: "h-3.5 w-3.5" }),
|
|
368
368
|
" ",
|
|
369
|
-
|
|
369
|
+
l("healthybowl.network.community.post.viewDiscussion", "View Discussion")
|
|
370
370
|
]
|
|
371
371
|
})
|
|
372
372
|
]
|
|
@@ -374,233 +374,233 @@ var C = () => {
|
|
|
374
374
|
]
|
|
375
375
|
}, e.id);
|
|
376
376
|
})
|
|
377
|
-
}) :
|
|
377
|
+
}) : N.length === 0 ? Me ? /* @__PURE__ */ v(ne, {}) : Ne ? /* @__PURE__ */ v(ee, { onRetry: () => void je() }) : /* @__PURE__ */ v(s, {
|
|
378
378
|
illustration: "empty-people",
|
|
379
|
-
title:
|
|
380
|
-
description:
|
|
381
|
-
action: /* @__PURE__ */
|
|
382
|
-
onClick: () =>
|
|
379
|
+
title: l("healthybowl.network.community.emptyState.noPosts.title", "No community posts yet"),
|
|
380
|
+
description: l("healthybowl.network.community.emptyState.noPosts.description", "Be the first to start a discussion. Create a post to share a question or experience with the community."),
|
|
381
|
+
action: /* @__PURE__ */ y(b, {
|
|
382
|
+
onClick: () => W(!0),
|
|
383
383
|
children: [
|
|
384
|
-
/* @__PURE__ */
|
|
384
|
+
/* @__PURE__ */ v(g, { className: "h-3.5 w-3.5" }),
|
|
385
385
|
" ",
|
|
386
|
-
|
|
386
|
+
l("healthybowl.network.community.actions.newPost", "New Post")
|
|
387
387
|
]
|
|
388
388
|
})
|
|
389
|
-
}) : /* @__PURE__ */
|
|
389
|
+
}) : /* @__PURE__ */ v(s, {
|
|
390
390
|
illustration: "empty-search",
|
|
391
|
-
title:
|
|
392
|
-
description:
|
|
393
|
-
action: /* @__PURE__ */
|
|
391
|
+
title: l("healthybowl.network.community.emptyState.noResults.title", "No posts found"),
|
|
392
|
+
description: l("healthybowl.network.community.emptyState.noResults.description", "No community posts match your current filters. Try adjusting your search or category."),
|
|
393
|
+
action: /* @__PURE__ */ v(b, {
|
|
394
394
|
onClick: () => {
|
|
395
|
-
|
|
395
|
+
L(""), z("All");
|
|
396
396
|
},
|
|
397
|
-
children:
|
|
397
|
+
children: l("healthybowl.network.community.actions.clearFilters", "Clear Filters")
|
|
398
398
|
})
|
|
399
399
|
}),
|
|
400
|
-
/* @__PURE__ */
|
|
401
|
-
open:
|
|
402
|
-
onClose: () =>
|
|
403
|
-
title:
|
|
404
|
-
description:
|
|
400
|
+
/* @__PURE__ */ v(c, {
|
|
401
|
+
open: ze,
|
|
402
|
+
onClose: () => W(!1),
|
|
403
|
+
title: l("healthybowl.network.community.newPostModal.title", "Create New Post"),
|
|
404
|
+
description: l("healthybowl.network.community.newPostModal.description", "Share your knowledge with the farming community"),
|
|
405
405
|
size: "lg",
|
|
406
|
-
footer: /* @__PURE__ */
|
|
406
|
+
footer: /* @__PURE__ */ y(_e, { children: [/* @__PURE__ */ v(b, {
|
|
407
407
|
variant: "outline",
|
|
408
|
-
onClick: () =>
|
|
409
|
-
children:
|
|
410
|
-
}), /* @__PURE__ */
|
|
408
|
+
onClick: () => W(!1),
|
|
409
|
+
children: l("healthybowl.common.cancel", "Cancel")
|
|
410
|
+
}), /* @__PURE__ */ v(b, {
|
|
411
411
|
onClick: it,
|
|
412
412
|
disabled: Ue,
|
|
413
|
-
children: Ue ?
|
|
413
|
+
children: Ue ? l("healthybowl.network.community.newPostModal.publishing", "Publishing…") : l("healthybowl.network.community.newPostModal.publish", "Publish Post")
|
|
414
414
|
})] }),
|
|
415
|
-
children: /* @__PURE__ */
|
|
415
|
+
children: /* @__PURE__ */ y("div", {
|
|
416
416
|
className: "space-y-4",
|
|
417
417
|
children: [
|
|
418
|
-
/* @__PURE__ */
|
|
418
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
|
|
419
419
|
className: "mb-1 block text-sm font-medium text-text-primary",
|
|
420
|
-
children:
|
|
421
|
-
}), /* @__PURE__ */
|
|
420
|
+
children: l("healthybowl.network.community.form.title.label", "Title")
|
|
421
|
+
}), /* @__PURE__ */ v("input", {
|
|
422
422
|
type: "text",
|
|
423
|
-
value:
|
|
424
|
-
onChange: (e) =>
|
|
425
|
-
placeholder:
|
|
423
|
+
value: G,
|
|
424
|
+
onChange: (e) => K(e.target.value),
|
|
425
|
+
placeholder: l("healthybowl.network.community.form.title.placeholder", "Enter a descriptive title..."),
|
|
426
426
|
className: "h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
427
427
|
})] }),
|
|
428
|
-
/* @__PURE__ */
|
|
428
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
|
|
429
429
|
className: "mb-1 block text-sm font-medium text-text-primary",
|
|
430
|
-
children:
|
|
431
|
-
}), /* @__PURE__ */
|
|
432
|
-
value:
|
|
433
|
-
onValueChange:
|
|
434
|
-
children: [/* @__PURE__ */
|
|
430
|
+
children: l("healthybowl.network.community.form.category.label", "Category")
|
|
431
|
+
}), /* @__PURE__ */ y(ve, {
|
|
432
|
+
value: q,
|
|
433
|
+
onValueChange: J,
|
|
434
|
+
children: [/* @__PURE__ */ v(xe, {
|
|
435
435
|
className: "h-9 w-full",
|
|
436
|
-
children: /* @__PURE__ */
|
|
437
|
-
}), /* @__PURE__ */
|
|
436
|
+
children: /* @__PURE__ */ v(Se, {})
|
|
437
|
+
}), /* @__PURE__ */ v(ye, { children: Pe.filter((e) => e !== "All").map((e) => /* @__PURE__ */ v(be, {
|
|
438
438
|
value: e,
|
|
439
|
-
children:
|
|
439
|
+
children: P[e] ?? e
|
|
440
440
|
}, e)) })]
|
|
441
441
|
})] }),
|
|
442
|
-
/* @__PURE__ */
|
|
442
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
|
|
443
443
|
className: "mb-1 block text-sm font-medium text-text-primary",
|
|
444
|
-
children:
|
|
445
|
-
}), /* @__PURE__ */
|
|
446
|
-
value:
|
|
447
|
-
onChange: (e) =>
|
|
448
|
-
placeholder:
|
|
444
|
+
children: l("healthybowl.network.community.form.content.label", "Content")
|
|
445
|
+
}), /* @__PURE__ */ v("textarea", {
|
|
446
|
+
value: Y,
|
|
447
|
+
onChange: (e) => Be(e.target.value),
|
|
448
|
+
placeholder: l("healthybowl.network.community.form.content.placeholder", "Share your thoughts, questions, or advice..."),
|
|
449
449
|
rows: 5,
|
|
450
450
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
451
451
|
})] }),
|
|
452
|
-
/* @__PURE__ */
|
|
453
|
-
/* @__PURE__ */
|
|
452
|
+
/* @__PURE__ */ y("div", { children: [
|
|
453
|
+
/* @__PURE__ */ v("label", {
|
|
454
454
|
className: "mb-1 block text-sm font-medium text-text-primary",
|
|
455
|
-
children:
|
|
455
|
+
children: l("healthybowl.network.community.form.tags.label", "Tags")
|
|
456
456
|
}),
|
|
457
|
-
/* @__PURE__ */
|
|
457
|
+
/* @__PURE__ */ v("input", {
|
|
458
458
|
type: "text",
|
|
459
459
|
value: Ve,
|
|
460
460
|
onChange: (e) => He(e.target.value),
|
|
461
|
-
placeholder:
|
|
461
|
+
placeholder: l("healthybowl.network.community.form.tags.placeholder", "Comma-separated tags (e.g., organic, soil, irrigation)"),
|
|
462
462
|
className: "h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
463
463
|
}),
|
|
464
|
-
/* @__PURE__ */
|
|
464
|
+
/* @__PURE__ */ v("p", {
|
|
465
465
|
className: "mt-1 text-xs text-text-secondary",
|
|
466
|
-
children:
|
|
466
|
+
children: l("healthybowl.network.community.form.tags.helper", "Separate tags with commas")
|
|
467
467
|
})
|
|
468
468
|
] })
|
|
469
469
|
]
|
|
470
470
|
})
|
|
471
471
|
}),
|
|
472
|
-
/* @__PURE__ */
|
|
473
|
-
open:
|
|
474
|
-
onClose: () =>
|
|
475
|
-
title:
|
|
476
|
-
description:
|
|
477
|
-
author:
|
|
478
|
-
category:
|
|
472
|
+
/* @__PURE__ */ v(c, {
|
|
473
|
+
open: H !== null,
|
|
474
|
+
onClose: () => U(null),
|
|
475
|
+
title: H?.title ?? l("healthybowl.network.community.viewModal.titleFallback", "Discussion"),
|
|
476
|
+
description: l("healthybowl.network.community.viewModal.description", "Posted by {{author}} in {{category}}", {
|
|
477
|
+
author: H?.author ?? "",
|
|
478
|
+
category: H?.category ?? ""
|
|
479
479
|
}),
|
|
480
480
|
size: "lg",
|
|
481
|
-
footer: /* @__PURE__ */
|
|
481
|
+
footer: /* @__PURE__ */ v(b, {
|
|
482
482
|
variant: "outline",
|
|
483
|
-
onClick: () =>
|
|
484
|
-
children:
|
|
483
|
+
onClick: () => U(null),
|
|
484
|
+
children: l("healthybowl.common.close", "Close")
|
|
485
485
|
}),
|
|
486
|
-
children:
|
|
486
|
+
children: H && /* @__PURE__ */ y("div", {
|
|
487
487
|
className: "space-y-4",
|
|
488
488
|
children: [
|
|
489
|
-
/* @__PURE__ */
|
|
489
|
+
/* @__PURE__ */ y("div", {
|
|
490
490
|
className: "flex items-center gap-2",
|
|
491
491
|
children: [
|
|
492
|
-
/* @__PURE__ */
|
|
492
|
+
/* @__PURE__ */ v("div", {
|
|
493
493
|
className: "flex h-8 w-8 items-center justify-center rounded-full bg-bg-sunken text-xs font-semibold text-text-primary",
|
|
494
|
-
children:
|
|
494
|
+
children: H.author.split(" ").map((e) => e[0]).join("")
|
|
495
495
|
}),
|
|
496
|
-
/* @__PURE__ */
|
|
496
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("span", {
|
|
497
497
|
className: "text-sm font-medium text-text-primary",
|
|
498
|
-
children:
|
|
499
|
-
}), /* @__PURE__ */
|
|
500
|
-
label:
|
|
498
|
+
children: H.author
|
|
499
|
+
}), /* @__PURE__ */ v(o, {
|
|
500
|
+
label: H.authorRole,
|
|
501
501
|
variant: "muted",
|
|
502
502
|
className: "ms-2"
|
|
503
503
|
})] }),
|
|
504
|
-
/* @__PURE__ */
|
|
504
|
+
/* @__PURE__ */ v("span", {
|
|
505
505
|
className: "ms-auto text-xs text-text-secondary",
|
|
506
|
-
children: n(
|
|
506
|
+
children: n(H.createdAt)
|
|
507
507
|
})
|
|
508
508
|
]
|
|
509
509
|
}),
|
|
510
|
-
/* @__PURE__ */
|
|
510
|
+
/* @__PURE__ */ v("p", {
|
|
511
511
|
className: "text-sm text-text-primary whitespace-pre-wrap",
|
|
512
|
-
children:
|
|
512
|
+
children: H.content
|
|
513
513
|
}),
|
|
514
|
-
/* @__PURE__ */
|
|
514
|
+
/* @__PURE__ */ y("div", {
|
|
515
515
|
className: "flex flex-wrap items-center gap-2",
|
|
516
|
-
children: [/* @__PURE__ */
|
|
517
|
-
label:
|
|
516
|
+
children: [/* @__PURE__ */ v(o, {
|
|
517
|
+
label: H.category,
|
|
518
518
|
variant: "default"
|
|
519
|
-
}),
|
|
519
|
+
}), H.tags.map((e) => /* @__PURE__ */ y("span", {
|
|
520
520
|
className: "flex items-center gap-1 rounded-full bg-bg-sunken px-2 py-0.5 text-xs text-text-secondary",
|
|
521
521
|
children: [
|
|
522
|
-
/* @__PURE__ */ _
|
|
522
|
+
/* @__PURE__ */ v(_, { className: "h-2.5 w-2.5" }),
|
|
523
523
|
" ",
|
|
524
524
|
e
|
|
525
525
|
]
|
|
526
526
|
}, e))]
|
|
527
527
|
}),
|
|
528
|
-
/* @__PURE__ */
|
|
528
|
+
/* @__PURE__ */ y("div", {
|
|
529
529
|
className: "flex items-center gap-4 border-t border-border-subtle pt-3 text-xs text-text-secondary",
|
|
530
|
-
children: [/* @__PURE__ */
|
|
530
|
+
children: [/* @__PURE__ */ y("span", {
|
|
531
531
|
className: "flex items-center gap-1",
|
|
532
532
|
children: [
|
|
533
|
-
/* @__PURE__ */
|
|
533
|
+
/* @__PURE__ */ v(m, { className: "h-3.5 w-3.5" }),
|
|
534
534
|
" ",
|
|
535
|
-
|
|
535
|
+
l("healthybowl.network.community.viewModal.likes", "{{count}} likes", { count: H.likes })
|
|
536
536
|
]
|
|
537
|
-
}), /* @__PURE__ */
|
|
537
|
+
}), /* @__PURE__ */ y("span", {
|
|
538
538
|
className: "flex items-center gap-1",
|
|
539
539
|
children: [
|
|
540
|
-
/* @__PURE__ */
|
|
540
|
+
/* @__PURE__ */ v(h, { className: "h-3.5 w-3.5" }),
|
|
541
541
|
" ",
|
|
542
|
-
|
|
542
|
+
l("healthybowl.network.community.viewModal.replies", "{{count}} replies", { count: H.replies })
|
|
543
543
|
]
|
|
544
544
|
})]
|
|
545
545
|
}),
|
|
546
|
-
/* @__PURE__ */
|
|
547
|
-
/* @__PURE__ */
|
|
546
|
+
/* @__PURE__ */ v(Te, { messageId: H.id }),
|
|
547
|
+
/* @__PURE__ */ y("div", {
|
|
548
548
|
className: "border-t border-border-subtle pt-3",
|
|
549
|
-
children: [/* @__PURE__ */
|
|
549
|
+
children: [/* @__PURE__ */ v("textarea", {
|
|
550
550
|
value: X,
|
|
551
551
|
onChange: (e) => Z(e.target.value),
|
|
552
|
-
placeholder:
|
|
552
|
+
placeholder: l("healthybowl.network.community.viewModal.replyPlaceholder", "Write a reply…"),
|
|
553
553
|
rows: 2,
|
|
554
554
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
555
|
-
}), /* @__PURE__ */
|
|
555
|
+
}), /* @__PURE__ */ v("div", {
|
|
556
556
|
className: "mt-2 flex justify-end",
|
|
557
|
-
children: /* @__PURE__ */
|
|
557
|
+
children: /* @__PURE__ */ v(b, {
|
|
558
558
|
size: "sm",
|
|
559
559
|
onClick: () => void at(),
|
|
560
560
|
disabled: qe || !X.trim(),
|
|
561
|
-
children: qe ?
|
|
561
|
+
children: qe ? l("healthybowl.network.community.viewModal.replying", "Posting…") : l("healthybowl.network.community.viewModal.reply", "Reply")
|
|
562
562
|
})
|
|
563
563
|
})]
|
|
564
564
|
})
|
|
565
565
|
]
|
|
566
566
|
})
|
|
567
567
|
}),
|
|
568
|
-
/* @__PURE__ */
|
|
568
|
+
/* @__PURE__ */ v(te, {
|
|
569
569
|
toasts: Ye,
|
|
570
570
|
onDismiss: Xe
|
|
571
571
|
})
|
|
572
572
|
]
|
|
573
573
|
});
|
|
574
574
|
}, Te = ({ messageId: e }) => {
|
|
575
|
-
let { t } =
|
|
575
|
+
let { t } = p(), { data: r, loading: i } = l({
|
|
576
576
|
variables: {
|
|
577
577
|
messageId: e,
|
|
578
578
|
first: 100
|
|
579
579
|
},
|
|
580
580
|
fetchPolicy: "cache-and-network"
|
|
581
|
-
}), a =
|
|
582
|
-
return i && a.length === 0 ? /* @__PURE__ */
|
|
581
|
+
}), a = d(() => (r?.thread.edges ?? []).map((e) => e.node), [r]);
|
|
582
|
+
return i && a.length === 0 ? /* @__PURE__ */ v("p", {
|
|
583
583
|
className: "text-xs text-text-secondary",
|
|
584
584
|
children: t("healthybowl.network.community.thread.loading", "Loading replies…")
|
|
585
|
-
}) : a.length === 0 ? /* @__PURE__ */
|
|
585
|
+
}) : a.length === 0 ? /* @__PURE__ */ v("p", {
|
|
586
586
|
className: "text-xs text-text-secondary",
|
|
587
587
|
children: t("healthybowl.network.community.thread.empty", "No replies yet. Be the first to respond.")
|
|
588
|
-
}) : /* @__PURE__ */
|
|
588
|
+
}) : /* @__PURE__ */ v("div", {
|
|
589
589
|
className: "space-y-3 border-t border-border-subtle pt-3",
|
|
590
590
|
children: a.map((e) => {
|
|
591
591
|
let r = e.content ?? {};
|
|
592
|
-
return /* @__PURE__ */
|
|
592
|
+
return /* @__PURE__ */ y("div", {
|
|
593
593
|
className: "rounded-md bg-bg-sunken/40 p-3",
|
|
594
|
-
children: [/* @__PURE__ */
|
|
594
|
+
children: [/* @__PURE__ */ y("div", {
|
|
595
595
|
className: "flex items-center justify-between",
|
|
596
|
-
children: [/* @__PURE__ */
|
|
596
|
+
children: [/* @__PURE__ */ v("span", {
|
|
597
597
|
className: "text-xs font-medium text-text-primary",
|
|
598
598
|
children: S(e.authorName) || S(r.payload?.author) || t("healthybowl.network.community.author.unknown", "Community member")
|
|
599
|
-
}), /* @__PURE__ */
|
|
599
|
+
}), /* @__PURE__ */ v("span", {
|
|
600
600
|
className: "text-[11px] text-text-secondary",
|
|
601
601
|
children: n(e.createdAt)
|
|
602
602
|
})]
|
|
603
|
-
}), /* @__PURE__ */
|
|
603
|
+
}), /* @__PURE__ */ v("p", {
|
|
604
604
|
className: "mt-1 whitespace-pre-wrap text-sm text-text-primary",
|
|
605
605
|
children: S(r.text)
|
|
606
606
|
})]
|