@burdenoff/microfe-comradecircle 2026.827.1 → 2026.830.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/comradecircle/components/AvatarUploadField.js +8 -8
- package/dist/comradecircle/components/CircleCard.js +4 -4
- package/dist/comradecircle/components/CommentThread.d.ts.map +1 -1
- package/dist/comradecircle/components/CommentThread.js +66 -61
- package/dist/comradecircle/components/CommentThread.js.map +1 -1
- package/dist/comradecircle/components/CreateCircleDialog.d.ts.map +1 -1
- package/dist/comradecircle/components/CreateCircleDialog.js +89 -88
- package/dist/comradecircle/components/CreateCircleDialog.js.map +1 -1
- package/dist/comradecircle/components/CreateEventDialog.d.ts.map +1 -1
- package/dist/comradecircle/components/CreateEventDialog.js +28 -27
- package/dist/comradecircle/components/CreateEventDialog.js.map +1 -1
- package/dist/comradecircle/components/DraftsPanel.js +13 -13
- package/dist/comradecircle/components/EventCard.js +5 -5
- package/dist/comradecircle/components/FileImage.js +5 -5
- package/dist/comradecircle/components/ImageAttachments.js +21 -21
- package/dist/comradecircle/components/MemberIdentity.js +4 -4
- package/dist/comradecircle/components/MobileBottomNav.d.ts.map +1 -1
- package/dist/comradecircle/components/MobileBottomNav.js +37 -30
- package/dist/comradecircle/components/MobileBottomNav.js.map +1 -1
- package/dist/comradecircle/components/Pagination.d.ts.map +1 -1
- package/dist/comradecircle/components/Pagination.js +37 -28
- package/dist/comradecircle/components/Pagination.js.map +1 -1
- package/dist/comradecircle/components/PollCard.js +13 -13
- package/dist/comradecircle/components/PostCard.d.ts.map +1 -1
- package/dist/comradecircle/components/PostCard.js +102 -89
- package/dist/comradecircle/components/PostCard.js.map +1 -1
- package/dist/comradecircle/components/PostComposer.js +4 -4
- package/dist/comradecircle/components/ReactionBar.d.ts.map +1 -1
- package/dist/comradecircle/components/ReactionBar.js +65 -55
- package/dist/comradecircle/components/ReactionBar.js.map +1 -1
- package/dist/comradecircle/components/StateViews.d.ts.map +1 -1
- package/dist/comradecircle/components/StateViews.js +38 -30
- package/dist/comradecircle/components/StateViews.js.map +1 -1
- package/dist/comradecircle/components/UpcomingEvents.js +17 -17
- package/dist/comradecircle/hooks/index.d.ts +1 -0
- package/dist/comradecircle/hooks/index.d.ts.map +1 -1
- package/dist/comradecircle/hooks/index.js +1 -0
- package/dist/comradecircle/hooks/useTr.d.ts +18 -0
- package/dist/comradecircle/hooks/useTr.d.ts.map +1 -0
- package/dist/comradecircle/hooks/useTr.js +12 -0
- package/dist/comradecircle/hooks/useTr.js.map +1 -0
- package/dist/comradecircle/pages/FeedPage.d.ts.map +1 -1
- package/dist/comradecircle/pages/FeedPage.js +75 -62
- package/dist/comradecircle/pages/FeedPage.js.map +1 -1
- package/dist/comradecircle/pages/circles/CircleDetailPage.d.ts.map +1 -1
- package/dist/comradecircle/pages/circles/CircleDetailPage.js +439 -401
- package/dist/comradecircle/pages/circles/CircleDetailPage.js.map +1 -1
- package/dist/comradecircle/pages/circles/CirclesPage.d.ts.map +1 -1
- package/dist/comradecircle/pages/circles/CirclesPage.js +124 -117
- package/dist/comradecircle/pages/circles/CirclesPage.js.map +1 -1
- package/dist/comradecircle/pages/events/EventDetailPage.d.ts.map +1 -1
- package/dist/comradecircle/pages/events/EventDetailPage.js +182 -153
- package/dist/comradecircle/pages/events/EventDetailPage.js.map +1 -1
- package/dist/comradecircle/pages/events/EventsPage.d.ts.map +1 -1
- package/dist/comradecircle/pages/events/EventsPage.js +100 -91
- package/dist/comradecircle/pages/events/EventsPage.js.map +1 -1
- package/dist/comradecircle/pages/members/MemberProfilePage.d.ts.map +1 -1
- package/dist/comradecircle/pages/members/MemberProfilePage.js +172 -159
- package/dist/comradecircle/pages/members/MemberProfilePage.js.map +1 -1
- package/dist/comradecircle/pages/members/MembersPage.d.ts.map +1 -1
- package/dist/comradecircle/pages/members/MembersPage.js +103 -104
- package/dist/comradecircle/pages/members/MembersPage.js.map +1 -1
- package/dist/comradecircle/pages/monetization/MonetizationPage.d.ts.map +1 -1
- package/dist/comradecircle/pages/monetization/MonetizationPage.js +319 -297
- package/dist/comradecircle/pages/monetization/MonetizationPage.js.map +1 -1
- package/dist/comradecircle/pages/posts/PostThreadPage.d.ts.map +1 -1
- package/dist/comradecircle/pages/posts/PostThreadPage.js +37 -32
- package/dist/comradecircle/pages/posts/PostThreadPage.js.map +1 -1
- package/dist/comradecircle/pages/profile/MyProfilePage.d.ts.map +1 -1
- package/dist/comradecircle/pages/profile/MyProfilePage.js +182 -177
- package/dist/comradecircle/pages/profile/MyProfilePage.js.map +1 -1
- package/dist/comradecircle/utils/i18n.js +15 -0
- package/dist/comradecircle/utils/i18n.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,209 +1,217 @@
|
|
|
1
1
|
import { useComradeCircle as e } from "../../context/ComradeCircleContext.js";
|
|
2
2
|
import "../../context/index.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { useCursorPager as p } from "../../hooks/useCursorPager.js";
|
|
3
|
+
import { useComCircle as t, useComCreateChannel as n, useComCreatePoll as r, useComEvents as i, useComJoinCircle as a, useComLeaveCircle as o, useComPolls as s, useComPostAddedLive as c, useComPosts as l, useComSetMemberRole as u } from "../../hooks/useComradeCircleApi.js";
|
|
4
|
+
import { useCursorPager as d } from "../../hooks/useCursorPager.js";
|
|
5
|
+
import { useTr as f } from "../../hooks/useTr.js";
|
|
7
6
|
import "../../hooks/index.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
7
|
+
import { cn as p } from "../../utils/cn.js";
|
|
8
|
+
import { PageLayout as m } from "../../components/PageLayout.js";
|
|
9
|
+
import { Avatar as h } from "../../components/Avatar.js";
|
|
10
|
+
import { MemberIdentity as g } from "../../components/MemberIdentity.js";
|
|
11
|
+
import { describeError as _, notify as v } from "../../lib/toast.js";
|
|
12
|
+
import { formatDate as y, formatEnumLabel as b, formatNumber as x } from "../../utils/formatters.js";
|
|
13
|
+
import { PostCard as S } from "../../components/PostCard.js";
|
|
14
|
+
import { EmptyState as C } from "../../components/EmptyState.js";
|
|
15
|
+
import { ErrorView as w, LoadingView as T } from "../../components/StateViews.js";
|
|
16
|
+
import { Pagination as E } from "../../components/Pagination.js";
|
|
17
|
+
import { slugify as D } from "../../utils/slug.js";
|
|
18
|
+
import { StatusBadge as O } from "../../components/StatusBadge.js";
|
|
18
19
|
import { Tabs as ee } from "../../components/Tabs.js";
|
|
19
|
-
import { PostComposer as
|
|
20
|
-
import { DraftsPanel as
|
|
21
|
-
import { EventCard as
|
|
22
|
-
import { PollCard as
|
|
23
|
-
import { CreateEventDialog as
|
|
24
|
-
import { useMemo as
|
|
25
|
-
import { ArrowLeft as
|
|
26
|
-
import { useParams as
|
|
27
|
-
import { Fragment as
|
|
28
|
-
import { Button as
|
|
20
|
+
import { PostComposer as k } from "../../components/PostComposer.js";
|
|
21
|
+
import { DraftsPanel as te } from "../../components/DraftsPanel.js";
|
|
22
|
+
import { EventCard as ne } from "../../components/EventCard.js";
|
|
23
|
+
import { PollCard as re } from "../../components/PollCard.js";
|
|
24
|
+
import { CreateEventDialog as ie } from "../../components/CreateEventDialog.js";
|
|
25
|
+
import { useMemo as A, useState as j } from "react";
|
|
26
|
+
import { ArrowLeft as ae, BarChart3 as M, CalendarDays as oe, Hash as N, Info as se, Megaphone as P, MessageCircle as ce, MessagesSquare as le, Mic as F, Plus as I, Search as ue, Users as L } from "lucide-react";
|
|
27
|
+
import { useParams as de } from "react-router";
|
|
28
|
+
import { Fragment as R, jsx as z, jsxs as B } from "react/jsx-runtime";
|
|
29
|
+
import { Button as V, GradientText as fe, Input as H, Label as U, ResponsiveDialog as pe, ResponsiveDialogContent as me, ResponsiveDialogDescription as W, ResponsiveDialogFooter as G, ResponsiveDialogHeader as K, ResponsiveDialogTitle as q, Select as J, SelectContent as Y, SelectItem as X, SelectTrigger as Z, SelectValue as Q, Switch as he, Textarea as ge } from "@burdenoff/fe-libs/ui";
|
|
29
30
|
//#region src/comradecircle/pages/circles/CircleDetailPage.tsx
|
|
30
31
|
var _e = {
|
|
31
|
-
TEXT:
|
|
32
|
-
FORUM:
|
|
33
|
-
ANNOUNCEMENT:
|
|
34
|
-
VOICE:
|
|
35
|
-
}, ve = ["OWNER", "ADMIN"],
|
|
32
|
+
TEXT: N,
|
|
33
|
+
FORUM: le,
|
|
34
|
+
ANNOUNCEMENT: P,
|
|
35
|
+
VOICE: F
|
|
36
|
+
}, ve = ["OWNER", "ADMIN"], $ = [
|
|
36
37
|
"OWNER",
|
|
37
38
|
"ADMIN",
|
|
38
39
|
"MODERATOR",
|
|
39
40
|
"MEMBER"
|
|
40
41
|
], ye = 15;
|
|
41
42
|
function be() {
|
|
42
|
-
let { id:
|
|
43
|
-
if (l) return /* @__PURE__ */
|
|
44
|
-
title: "Circle",
|
|
45
|
-
children: /* @__PURE__ */
|
|
43
|
+
let n = f(), { id: r } = de(), { currentUser: i, navigateTo: s } = e(), { data: c, isLoading: l, isError: u, refetch: d } = t(r), p = a(), g = o(), [y, b] = j("channels"), S = A(() => c?.memberships?.find((e) => e.memberId === i?.id && e.status === "ACTIVE"), [c, i]), C = !!S, E = S ? ve.includes(S.role) : !1;
|
|
44
|
+
if (l) return /* @__PURE__ */ z(m, {
|
|
45
|
+
title: n("comradecircle.pages.circleDetail.title", "Circle"),
|
|
46
|
+
children: /* @__PURE__ */ z(T, { label: n("comradecircle.pages.circleDetail.loadingCircle", "Loading circle…") })
|
|
46
47
|
});
|
|
47
|
-
if (u || !
|
|
48
|
-
title: "Circle",
|
|
49
|
-
children: /* @__PURE__ */
|
|
50
|
-
title: "Circle not found",
|
|
51
|
-
message: "This circle may have been archived or you may not have access.",
|
|
48
|
+
if (u || !c) return /* @__PURE__ */ z(m, {
|
|
49
|
+
title: n("comradecircle.pages.circleDetail.title", "Circle"),
|
|
50
|
+
children: /* @__PURE__ */ z(w, {
|
|
51
|
+
title: n("comradecircle.pages.circleDetail.notFoundTitle", "Circle not found"),
|
|
52
|
+
message: n("comradecircle.pages.circleDetail.notFoundMessage", "This circle may have been archived or you may not have access."),
|
|
52
53
|
onRetry: () => d()
|
|
53
54
|
})
|
|
54
55
|
});
|
|
55
|
-
let
|
|
56
|
+
let D = c.memberships?.filter((e) => e.status === "ACTIVE") ?? [], k = [
|
|
56
57
|
{
|
|
57
58
|
value: "channels",
|
|
58
|
-
label: "Channels",
|
|
59
|
-
icon: /* @__PURE__ */
|
|
60
|
-
count:
|
|
59
|
+
label: n("comradecircle.pages.circleDetail.tabChannels", "Channels"),
|
|
60
|
+
icon: /* @__PURE__ */ z(N, { className: "h-4 w-4" }),
|
|
61
|
+
count: c.channels?.length ?? 0
|
|
61
62
|
},
|
|
62
63
|
{
|
|
63
64
|
value: "members",
|
|
64
|
-
label: "Members",
|
|
65
|
-
icon: /* @__PURE__ */ L
|
|
66
|
-
count:
|
|
65
|
+
label: n("comradecircle.pages.circleDetail.tabMembers", "Members"),
|
|
66
|
+
icon: /* @__PURE__ */ z(L, { className: "h-4 w-4" }),
|
|
67
|
+
count: D.length
|
|
67
68
|
},
|
|
68
69
|
{
|
|
69
70
|
value: "events",
|
|
70
|
-
label: "Events",
|
|
71
|
-
icon: /* @__PURE__ */
|
|
71
|
+
label: n("comradecircle.pages.circleDetail.tabEvents", "Events"),
|
|
72
|
+
icon: /* @__PURE__ */ z(oe, { className: "h-4 w-4" })
|
|
72
73
|
},
|
|
73
74
|
{
|
|
74
75
|
value: "polls",
|
|
75
|
-
label: "Polls",
|
|
76
|
-
icon: /* @__PURE__ */
|
|
76
|
+
label: n("comradecircle.pages.circleDetail.tabPolls", "Polls"),
|
|
77
|
+
icon: /* @__PURE__ */ z(M, { className: "h-4 w-4" })
|
|
77
78
|
},
|
|
78
79
|
{
|
|
79
80
|
value: "about",
|
|
80
|
-
label: "About",
|
|
81
|
-
icon: /* @__PURE__ */
|
|
81
|
+
label: n("comradecircle.pages.circleDetail.tabAbout", "About"),
|
|
82
|
+
icon: /* @__PURE__ */ z(se, { className: "h-4 w-4" })
|
|
82
83
|
}
|
|
83
84
|
];
|
|
84
|
-
return /* @__PURE__ */
|
|
85
|
-
title: /* @__PURE__ */
|
|
85
|
+
return /* @__PURE__ */ B(m, {
|
|
86
|
+
title: /* @__PURE__ */ B("span", {
|
|
86
87
|
className: "flex items-center gap-3",
|
|
87
|
-
children: [/* @__PURE__ */
|
|
88
|
-
name:
|
|
88
|
+
children: [/* @__PURE__ */ z(h, {
|
|
89
|
+
name: c.name,
|
|
89
90
|
size: "lg",
|
|
90
|
-
fileId:
|
|
91
|
-
seed:
|
|
91
|
+
fileId: c.avatar?.id,
|
|
92
|
+
seed: c.id,
|
|
92
93
|
ring: !0
|
|
93
|
-
}), /* @__PURE__ */
|
|
94
|
+
}), /* @__PURE__ */ z(fe, {
|
|
94
95
|
as: "span",
|
|
95
96
|
className: "text-2xl font-semibold tracking-tight",
|
|
96
|
-
children:
|
|
97
|
+
children: c.name
|
|
97
98
|
})]
|
|
98
99
|
}),
|
|
99
|
-
description:
|
|
100
|
+
description: c.topic ?? void 0,
|
|
100
101
|
aurora: !0,
|
|
101
|
-
actions: /* @__PURE__ */
|
|
102
|
+
actions: /* @__PURE__ */ B("div", {
|
|
102
103
|
className: "flex items-center gap-2",
|
|
103
|
-
children: [/* @__PURE__ */
|
|
104
|
+
children: [/* @__PURE__ */ B(V, {
|
|
104
105
|
variant: "ghost",
|
|
105
106
|
size: "sm",
|
|
106
|
-
onClick: () =>
|
|
107
|
-
children: [
|
|
108
|
-
|
|
107
|
+
onClick: () => s("circles"),
|
|
108
|
+
children: [
|
|
109
|
+
/* @__PURE__ */ z(ae, { className: "mr-1.5 h-4 w-4" }),
|
|
110
|
+
" ",
|
|
111
|
+
n("common.back", "Back")
|
|
112
|
+
]
|
|
113
|
+
}), C ? /* @__PURE__ */ z(V, {
|
|
109
114
|
variant: "outline",
|
|
110
|
-
onClick: () =>
|
|
115
|
+
onClick: () => g.mutateAsync(c.id).then(() => v.success(n("comradecircle.pages.circleDetail.left", "Left circle"))).catch((e) => v.error(n("comradecircle.pages.circleDetail.leaveError", "Could not leave"), _(e))),
|
|
116
|
+
disabled: g.isPending,
|
|
117
|
+
children: n("comradecircle.pages.circleDetail.leave", "Leave")
|
|
118
|
+
}) : c.status === "ACTIVE" ? /* @__PURE__ */ z(V, {
|
|
119
|
+
onClick: () => p.mutateAsync(c.id).then(() => v.success(n("comradecircle.pages.circleDetail.joined", "Joined circle"))).catch((e) => v.error(n("comradecircle.pages.circleDetail.joinError", "Could not join"), _(e))),
|
|
111
120
|
disabled: p.isPending,
|
|
112
|
-
children: "
|
|
113
|
-
}) : o.status === "ACTIVE" ? /* @__PURE__ */ L(z, {
|
|
114
|
-
onClick: () => f.mutateAsync(o.id).then(() => _.success("Joined circle")).catch((e) => _.error("Could not join", g(e))),
|
|
115
|
-
disabled: f.isPending,
|
|
116
|
-
children: "Join circle"
|
|
121
|
+
children: n("comradecircle.pages.circleDetail.joinCircle", "Join circle")
|
|
117
122
|
}) : null]
|
|
118
123
|
}),
|
|
119
124
|
children: [
|
|
120
|
-
/* @__PURE__ */
|
|
125
|
+
/* @__PURE__ */ B("div", {
|
|
121
126
|
className: "mb-4 flex flex-wrap items-center gap-2",
|
|
122
127
|
children: [
|
|
123
|
-
/* @__PURE__ */
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
/* @__PURE__ */
|
|
128
|
+
/* @__PURE__ */ z(O, { status: c.visibility }),
|
|
129
|
+
c.status !== "ACTIVE" && /* @__PURE__ */ z(O, { status: c.status }),
|
|
130
|
+
S && /* @__PURE__ */ z(O, { status: S.role }),
|
|
131
|
+
/* @__PURE__ */ B("span", {
|
|
127
132
|
className: "inline-flex items-center gap-1 text-sm text-text-tertiary",
|
|
128
133
|
children: [
|
|
129
|
-
/* @__PURE__ */ L
|
|
134
|
+
/* @__PURE__ */ z(L, { className: "h-4 w-4" }),
|
|
130
135
|
" ",
|
|
131
|
-
|
|
132
|
-
" members"
|
|
136
|
+
n("comradecircle.pages.circleDetail.memberCount", "{{count}} members", { count: x(c.memberCount) })
|
|
133
137
|
]
|
|
134
138
|
})
|
|
135
139
|
]
|
|
136
140
|
}),
|
|
137
|
-
/* @__PURE__ */
|
|
138
|
-
items:
|
|
139
|
-
value:
|
|
140
|
-
onChange:
|
|
141
|
+
/* @__PURE__ */ z(ee, {
|
|
142
|
+
items: k,
|
|
143
|
+
value: y,
|
|
144
|
+
onChange: b,
|
|
141
145
|
className: "mb-5"
|
|
142
146
|
}),
|
|
143
|
-
|
|
144
|
-
circle:
|
|
145
|
-
isMember:
|
|
146
|
-
canManage:
|
|
147
|
+
y === "channels" && /* @__PURE__ */ z(xe, {
|
|
148
|
+
circle: c,
|
|
149
|
+
isMember: C,
|
|
150
|
+
canManage: E
|
|
147
151
|
}),
|
|
148
|
-
|
|
149
|
-
circle:
|
|
150
|
-
canManage:
|
|
152
|
+
y === "members" && /* @__PURE__ */ z(Ce, {
|
|
153
|
+
circle: c,
|
|
154
|
+
canManage: E
|
|
151
155
|
}),
|
|
152
|
-
|
|
153
|
-
circle:
|
|
154
|
-
isMember:
|
|
156
|
+
y === "events" && /* @__PURE__ */ z(we, {
|
|
157
|
+
circle: c,
|
|
158
|
+
isMember: C
|
|
155
159
|
}),
|
|
156
|
-
|
|
157
|
-
circle:
|
|
158
|
-
isMember:
|
|
159
|
-
canManage:
|
|
160
|
+
y === "polls" && /* @__PURE__ */ z(Te, {
|
|
161
|
+
circle: c,
|
|
162
|
+
isMember: C,
|
|
163
|
+
canManage: E
|
|
160
164
|
}),
|
|
161
|
-
|
|
165
|
+
y === "about" && /* @__PURE__ */ z(Ee, { circle: c })
|
|
162
166
|
]
|
|
163
167
|
});
|
|
164
168
|
}
|
|
165
|
-
function xe({ circle: e, isMember:
|
|
166
|
-
let i =
|
|
167
|
-
return i.length === 0 ? /* @__PURE__ */ R
|
|
168
|
-
icon: /* @__PURE__ */
|
|
169
|
-
title: "No channels yet",
|
|
170
|
-
description:
|
|
171
|
-
action:
|
|
169
|
+
function xe({ circle: e, isMember: t, canManage: n }) {
|
|
170
|
+
let r = f(), i = A(() => [...e.channels ?? []].sort((e, t) => e.position - t.position), [e.channels]), [a, o] = j(i[0]?.id), [s, c] = j(!1), l = i.find((e) => e.id === a) ?? i[0];
|
|
171
|
+
return i.length === 0 ? /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(C, {
|
|
172
|
+
icon: /* @__PURE__ */ z(N, { className: "h-10 w-10" }),
|
|
173
|
+
title: r("comradecircle.pages.circleDetail.noChannelsTitle", "No channels yet"),
|
|
174
|
+
description: n ? r("comradecircle.pages.circleDetail.noChannelsDescriptionManager", "Create the first channel to start conversations in this circle.") : r("comradecircle.pages.circleDetail.noChannelsDescriptionMember", "This circle has no channels yet. Check back soon."),
|
|
175
|
+
action: n ? /* @__PURE__ */ B(V, {
|
|
172
176
|
onClick: () => c(!0),
|
|
173
|
-
children: [
|
|
177
|
+
children: [
|
|
178
|
+
/* @__PURE__ */ z(I, { className: "mr-1.5 h-4 w-4" }),
|
|
179
|
+
" ",
|
|
180
|
+
r("comradecircle.pages.circleDetail.newChannel", "New channel")
|
|
181
|
+
]
|
|
174
182
|
}) : void 0
|
|
175
|
-
}), /* @__PURE__ */
|
|
183
|
+
}), /* @__PURE__ */ z(Oe, {
|
|
176
184
|
circleId: e.id,
|
|
177
185
|
open: s,
|
|
178
186
|
onOpenChange: c,
|
|
179
187
|
onCreated: (e) => o(e.id)
|
|
180
|
-
})] }) : /* @__PURE__ */
|
|
188
|
+
})] }) : /* @__PURE__ */ B("div", {
|
|
181
189
|
className: "grid gap-5 lg:grid-cols-[220px_1fr]",
|
|
182
190
|
children: [
|
|
183
|
-
/* @__PURE__ */
|
|
191
|
+
/* @__PURE__ */ B("aside", {
|
|
184
192
|
className: "hidden lg:block",
|
|
185
|
-
children: [/* @__PURE__ */
|
|
193
|
+
children: [/* @__PURE__ */ B("div", {
|
|
186
194
|
className: "mb-2 flex items-center justify-between",
|
|
187
|
-
children: [/* @__PURE__ */
|
|
195
|
+
children: [/* @__PURE__ */ z("h3", {
|
|
188
196
|
className: "text-xs font-semibold uppercase tracking-wide text-text-tertiary",
|
|
189
|
-
children: "Channels"
|
|
190
|
-
}),
|
|
197
|
+
children: r("comradecircle.pages.circleDetail.tabChannels", "Channels")
|
|
198
|
+
}), n && /* @__PURE__ */ z("button", {
|
|
191
199
|
type: "button",
|
|
192
200
|
onClick: () => c(!0),
|
|
193
|
-
"aria-label": "New channel",
|
|
201
|
+
"aria-label": r("comradecircle.pages.circleDetail.newChannel", "New channel"),
|
|
194
202
|
className: "rounded-md p-1 text-text-tertiary hover:bg-bg-sunken hover:text-text-primary",
|
|
195
|
-
children: /* @__PURE__ */
|
|
203
|
+
children: /* @__PURE__ */ z(I, { className: "h-4 w-4" })
|
|
196
204
|
})]
|
|
197
|
-
}), /* @__PURE__ */
|
|
205
|
+
}), /* @__PURE__ */ z("nav", {
|
|
198
206
|
className: "flex flex-col gap-0.5",
|
|
199
207
|
children: i.map((e) => {
|
|
200
|
-
let
|
|
201
|
-
return /* @__PURE__ */
|
|
208
|
+
let t = _e[e.type], n = e.id === l?.id, r = e.type === "ANNOUNCEMENT";
|
|
209
|
+
return /* @__PURE__ */ B("button", {
|
|
202
210
|
type: "button",
|
|
203
211
|
onClick: () => o(e.id),
|
|
204
|
-
"aria-current":
|
|
205
|
-
className:
|
|
206
|
-
children: [/* @__PURE__ */
|
|
212
|
+
"aria-current": n ? "true" : void 0,
|
|
213
|
+
className: p("flex items-center gap-2 rounded-lg border-l-2 px-2.5 py-1.5 text-left text-sm transition-all", n ? "border-[color:var(--color-accent)] bg-[var(--color-accent-soft)] font-medium text-text-primary shadow-sm" : r ? "border-transparent font-medium text-accent hover:bg-bg-sunken motion-safe:hover:translate-x-0.5" : "border-transparent text-text-secondary hover:bg-bg-sunken hover:text-text-primary motion-safe:hover:translate-x-0.5"),
|
|
214
|
+
children: [/* @__PURE__ */ z(t, { className: p("h-4 w-4 shrink-0", n || r ? "text-accent" : "text-text-tertiary") }), /* @__PURE__ */ z("span", {
|
|
207
215
|
className: "truncate",
|
|
208
216
|
children: e.name
|
|
209
217
|
})]
|
|
@@ -211,35 +219,35 @@ function xe({ circle: e, isMember: n, canManage: r }) {
|
|
|
211
219
|
})
|
|
212
220
|
})]
|
|
213
221
|
}),
|
|
214
|
-
/* @__PURE__ */
|
|
222
|
+
/* @__PURE__ */ z("div", {
|
|
215
223
|
className: "lg:hidden",
|
|
216
|
-
children: /* @__PURE__ */
|
|
224
|
+
children: /* @__PURE__ */ B("div", {
|
|
217
225
|
className: "flex items-center gap-2",
|
|
218
|
-
children: [/* @__PURE__ */
|
|
226
|
+
children: [/* @__PURE__ */ B(J, {
|
|
219
227
|
value: l?.id,
|
|
220
228
|
onValueChange: o,
|
|
221
|
-
children: [/* @__PURE__ */
|
|
229
|
+
children: [/* @__PURE__ */ z(Z, { children: /* @__PURE__ */ z(Q, { placeholder: r("comradecircle.pages.circleDetail.selectChannel", "Select a channel") }) }), /* @__PURE__ */ z(Y, { children: i.map((e) => /* @__PURE__ */ B(X, {
|
|
222
230
|
value: e.id,
|
|
223
231
|
children: ["#", e.name]
|
|
224
232
|
}, e.id)) })]
|
|
225
|
-
}),
|
|
233
|
+
}), n && /* @__PURE__ */ z(V, {
|
|
226
234
|
variant: "outline",
|
|
227
235
|
size: "icon",
|
|
228
236
|
onClick: () => c(!0),
|
|
229
|
-
"aria-label": "New channel",
|
|
230
|
-
children: /* @__PURE__ */
|
|
237
|
+
"aria-label": r("comradecircle.pages.circleDetail.newChannel", "New channel"),
|
|
238
|
+
children: /* @__PURE__ */ z(I, { className: "h-4 w-4" })
|
|
231
239
|
})]
|
|
232
240
|
})
|
|
233
241
|
}),
|
|
234
|
-
/* @__PURE__ */
|
|
242
|
+
/* @__PURE__ */ z("div", {
|
|
235
243
|
className: "min-w-0",
|
|
236
|
-
children: l && /* @__PURE__ */
|
|
244
|
+
children: l && /* @__PURE__ */ z(Se, {
|
|
237
245
|
channel: l,
|
|
238
|
-
canPost:
|
|
239
|
-
canManage:
|
|
246
|
+
canPost: t,
|
|
247
|
+
canManage: n
|
|
240
248
|
})
|
|
241
249
|
}),
|
|
242
|
-
/* @__PURE__ */
|
|
250
|
+
/* @__PURE__ */ z(Oe, {
|
|
243
251
|
circleId: e.id,
|
|
244
252
|
open: s,
|
|
245
253
|
onOpenChange: c,
|
|
@@ -249,175 +257,178 @@ function xe({ circle: e, isMember: n, canManage: r }) {
|
|
|
249
257
|
});
|
|
250
258
|
}
|
|
251
259
|
function Se({ channel: e, canPost: t, canManage: n }) {
|
|
252
|
-
let r =
|
|
260
|
+
let r = f(), i = d(), [a, o] = j(!1), { data: s, isLoading: u, isError: p, refetch: m } = l({
|
|
253
261
|
channelId: e.id,
|
|
254
262
|
status: "PUBLISHED",
|
|
255
263
|
pagination: {
|
|
256
264
|
limit: ye,
|
|
257
|
-
cursor:
|
|
265
|
+
cursor: i.cursor
|
|
258
266
|
}
|
|
259
267
|
});
|
|
260
|
-
|
|
261
|
-
let
|
|
262
|
-
return /* @__PURE__ */
|
|
268
|
+
c(e.id);
|
|
269
|
+
let h = s?.items ?? [], g = e.type === "ANNOUNCEMENT", _ = e.type === "VOICE" ? !1 : g ? n : t, v = g && i.page === 0 && h.length > 0 ? h.find((e) => e.isPinned) ?? h[0] : void 0, y = v ? h.filter((e) => e.id !== v.id) : h;
|
|
270
|
+
return /* @__PURE__ */ B("div", {
|
|
263
271
|
className: "flex flex-col gap-4",
|
|
264
272
|
children: [
|
|
265
|
-
/* @__PURE__ */
|
|
273
|
+
/* @__PURE__ */ B("div", {
|
|
266
274
|
className: "flex items-center gap-3",
|
|
267
275
|
children: [(() => {
|
|
268
276
|
let t = _e[e.type];
|
|
269
|
-
return /* @__PURE__ */
|
|
277
|
+
return /* @__PURE__ */ z("span", {
|
|
270
278
|
className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-[var(--color-accent-soft)] text-accent",
|
|
271
|
-
children: /* @__PURE__ */
|
|
279
|
+
children: /* @__PURE__ */ z(t, { className: "h-5 w-5" })
|
|
272
280
|
});
|
|
273
|
-
})(), /* @__PURE__ */
|
|
281
|
+
})(), /* @__PURE__ */ B("div", {
|
|
274
282
|
className: "min-w-0",
|
|
275
|
-
children: [/* @__PURE__ */
|
|
283
|
+
children: [/* @__PURE__ */ B("div", {
|
|
276
284
|
className: "flex items-center gap-2",
|
|
277
|
-
children: [/* @__PURE__ */
|
|
285
|
+
children: [/* @__PURE__ */ z("h2", {
|
|
278
286
|
className: "text-lg font-semibold text-text-primary",
|
|
279
287
|
children: e.name
|
|
280
|
-
}),
|
|
288
|
+
}), g && /* @__PURE__ */ B("span", {
|
|
281
289
|
className: "inline-flex items-center gap-1 rounded-full bg-[var(--color-accent-soft)] px-2 py-0.5 text-xs font-medium text-accent",
|
|
282
|
-
children: [
|
|
290
|
+
children: [
|
|
291
|
+
/* @__PURE__ */ z(P, { className: "h-3 w-3" }),
|
|
292
|
+
" ",
|
|
293
|
+
r("comradecircle.pages.circleDetail.broadcastLabel", "Broadcast")
|
|
294
|
+
]
|
|
283
295
|
})]
|
|
284
|
-
}), e.description && /* @__PURE__ */
|
|
296
|
+
}), e.description && /* @__PURE__ */ z("p", {
|
|
285
297
|
className: "text-sm text-text-secondary",
|
|
286
298
|
children: e.description
|
|
287
299
|
})]
|
|
288
300
|
})]
|
|
289
301
|
}),
|
|
290
|
-
|
|
302
|
+
_ && /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(k, {
|
|
291
303
|
channelId: e.id,
|
|
292
304
|
channelName: e.name,
|
|
293
|
-
onPosted: () =>
|
|
294
|
-
onDraftSaved: () =>
|
|
295
|
-
variant:
|
|
296
|
-
}), /* @__PURE__ */
|
|
305
|
+
onPosted: () => i.reset(),
|
|
306
|
+
onDraftSaved: () => o(!0),
|
|
307
|
+
variant: g ? "announcement" : "default"
|
|
308
|
+
}), /* @__PURE__ */ z(te, {
|
|
297
309
|
channelId: e.id,
|
|
298
|
-
open:
|
|
299
|
-
onOpenChange:
|
|
300
|
-
variant:
|
|
310
|
+
open: a,
|
|
311
|
+
onOpenChange: o,
|
|
312
|
+
variant: g ? "announcement" : "default"
|
|
301
313
|
})] }),
|
|
302
|
-
|
|
314
|
+
g && !_ && /* @__PURE__ */ B("div", {
|
|
303
315
|
className: "rounded-xl border border-dashed border-border-seam p-6 text-center text-sm text-text-secondary",
|
|
304
|
-
children: [/* @__PURE__ */
|
|
316
|
+
children: [/* @__PURE__ */ z(P, { className: "mx-auto mb-2 h-6 w-6 text-text-tertiary" }), r("comradecircle.pages.circleDetail.announcementReadOnly", "Only circle managers can post in announcement channels.")]
|
|
305
317
|
}),
|
|
306
|
-
e.type === "VOICE" && /* @__PURE__ */
|
|
318
|
+
e.type === "VOICE" && /* @__PURE__ */ B("div", {
|
|
307
319
|
className: "rounded-xl border border-dashed border-border-seam p-6 text-center text-sm text-text-secondary",
|
|
308
|
-
children: [/* @__PURE__ */
|
|
320
|
+
children: [/* @__PURE__ */ z(F, { className: "mx-auto mb-2 h-6 w-6 text-text-tertiary" }), r("comradecircle.pages.circleDetail.voiceReadOnly", "Voice channels are for live audio. Text posting is disabled here.")]
|
|
309
321
|
}),
|
|
310
|
-
|
|
311
|
-
message: "We couldn't load posts.",
|
|
312
|
-
onRetry: () =>
|
|
313
|
-
}) :
|
|
314
|
-
icon: /* @__PURE__ */
|
|
315
|
-
title: "No posts yet",
|
|
316
|
-
description:
|
|
317
|
-
}) : /* @__PURE__ */
|
|
322
|
+
u ? /* @__PURE__ */ z(T, { label: r("comradecircle.pages.circleDetail.loadingPosts", "Loading posts…") }) : p ? /* @__PURE__ */ z(w, {
|
|
323
|
+
message: r("comradecircle.pages.circleDetail.postsError", "We couldn't load posts."),
|
|
324
|
+
onRetry: () => m()
|
|
325
|
+
}) : h.length === 0 ? /* @__PURE__ */ z(C, {
|
|
326
|
+
icon: /* @__PURE__ */ z(ce, { className: "h-9 w-9" }),
|
|
327
|
+
title: r("comradecircle.pages.circleDetail.noPostsTitle", "No posts yet"),
|
|
328
|
+
description: _ ? r("comradecircle.pages.circleDetail.noPostsDescriptionCanWrite", "Be the first to post in this channel.") : r("comradecircle.pages.circleDetail.noPostsDescriptionReadOnly", "Nothing has been posted here yet.")
|
|
329
|
+
}) : /* @__PURE__ */ B("div", {
|
|
318
330
|
className: "flex flex-col gap-4",
|
|
319
331
|
children: [
|
|
320
|
-
|
|
332
|
+
v && /* @__PURE__ */ B("div", {
|
|
321
333
|
className: "rounded-2xl border-2 border-[color:var(--color-accent)] bg-[var(--color-accent-soft)] p-1",
|
|
322
|
-
children: [/* @__PURE__ */
|
|
334
|
+
children: [/* @__PURE__ */ B("div", {
|
|
323
335
|
className: "mb-1 flex items-center gap-1.5 px-3 pt-2 text-xs font-semibold uppercase tracking-wide text-accent",
|
|
324
|
-
children: [/* @__PURE__ */
|
|
325
|
-
}), /* @__PURE__ */
|
|
336
|
+
children: [/* @__PURE__ */ z(P, { className: "h-3.5 w-3.5" }), v.isPinned ? r("comradecircle.pages.circleDetail.pinnedAnnouncement", "Pinned announcement") : r("comradecircle.pages.circleDetail.latestAnnouncement", "Latest announcement")]
|
|
337
|
+
}), /* @__PURE__ */ z(S, { post: v })]
|
|
326
338
|
}),
|
|
327
|
-
|
|
339
|
+
y.length > 0 && /* @__PURE__ */ B("div", {
|
|
328
340
|
className: "flex flex-col gap-4",
|
|
329
|
-
children: [
|
|
341
|
+
children: [v && /* @__PURE__ */ z("p", {
|
|
330
342
|
className: "text-xs font-semibold uppercase tracking-wide text-text-tertiary",
|
|
331
|
-
children: "Earlier announcements"
|
|
332
|
-
}),
|
|
343
|
+
children: r("comradecircle.pages.circleDetail.earlierAnnouncements", "Earlier announcements")
|
|
344
|
+
}), y.map((e) => /* @__PURE__ */ z(S, { post: e }, e.id))]
|
|
333
345
|
}),
|
|
334
|
-
/* @__PURE__ */
|
|
335
|
-
page:
|
|
346
|
+
/* @__PURE__ */ z(E, {
|
|
347
|
+
page: i.page,
|
|
336
348
|
pageSize: ye,
|
|
337
|
-
itemCount:
|
|
338
|
-
hasMore:
|
|
339
|
-
onPageChange: (e) =>
|
|
349
|
+
itemCount: h.length,
|
|
350
|
+
hasMore: s?.pageInfo.hasMore ?? !1,
|
|
351
|
+
onPageChange: (e) => i.onPageChange(e, s?.pageInfo.cursor)
|
|
340
352
|
})
|
|
341
353
|
]
|
|
342
354
|
})
|
|
343
355
|
]
|
|
344
356
|
});
|
|
345
357
|
}
|
|
346
|
-
function Ce({ circle: e, canManage:
|
|
347
|
-
let
|
|
358
|
+
function Ce({ circle: e, canManage: t }) {
|
|
359
|
+
let n = f(), r = u(), [i, a] = j(""), o = A(() => [...e.memberships ?? []].sort((e, t) => $.indexOf(e.role) - $.indexOf(t.role)), [e.memberships]), s = A(() => {
|
|
348
360
|
let e = i.trim().toLowerCase();
|
|
349
|
-
return e ? o.filter((t) =>
|
|
361
|
+
return e ? o.filter((t) => b(t.role).toLowerCase().includes(e) || t.role.toLowerCase().includes(e) || b(t.status).toLowerCase().includes(e) || t.status.toLowerCase().includes(e)) : o;
|
|
350
362
|
}, [o, i]);
|
|
351
|
-
if (o.length === 0) return /* @__PURE__ */
|
|
352
|
-
icon: /* @__PURE__ */ L
|
|
353
|
-
title: "No members yet"
|
|
363
|
+
if (o.length === 0) return /* @__PURE__ */ z(C, {
|
|
364
|
+
icon: /* @__PURE__ */ z(L, { className: "h-9 w-9" }),
|
|
365
|
+
title: n("comradecircle.pages.circleDetail.noMembersTitle", "No members yet")
|
|
354
366
|
});
|
|
355
|
-
let c = async (t,
|
|
367
|
+
let c = async (t, i) => {
|
|
356
368
|
try {
|
|
357
369
|
await r.mutateAsync({
|
|
358
370
|
membershipId: t,
|
|
359
|
-
role:
|
|
371
|
+
role: i,
|
|
360
372
|
circleId: e.id
|
|
361
|
-
}),
|
|
373
|
+
}), v.success(n("comradecircle.pages.circleDetail.roleUpdated", "Role updated"));
|
|
362
374
|
} catch (e) {
|
|
363
|
-
|
|
375
|
+
v.error(n("comradecircle.pages.circleDetail.roleUpdateError", "Could not update role"), _(e));
|
|
364
376
|
}
|
|
365
|
-
}, l =
|
|
366
|
-
return /* @__PURE__ */
|
|
377
|
+
}, l = t ? "lg:grid-cols-[minmax(0,1fr)_120px_120px_190px]" : "lg:grid-cols-[minmax(0,1fr)_120px_120px]";
|
|
378
|
+
return /* @__PURE__ */ B("div", {
|
|
367
379
|
className: "flex flex-col gap-4",
|
|
368
|
-
children: [/* @__PURE__ */
|
|
380
|
+
children: [/* @__PURE__ */ B("div", {
|
|
369
381
|
className: "flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",
|
|
370
|
-
children: [/* @__PURE__ */
|
|
382
|
+
children: [/* @__PURE__ */ B("div", {
|
|
371
383
|
className: "relative w-full sm:max-w-xs",
|
|
372
|
-
children: [/* @__PURE__ */
|
|
384
|
+
children: [/* @__PURE__ */ z(ue, { className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-tertiary" }), /* @__PURE__ */ z(H, {
|
|
373
385
|
value: i,
|
|
374
386
|
onChange: (e) => a(e.target.value),
|
|
375
|
-
placeholder: "Filter by role or status…",
|
|
387
|
+
placeholder: n("comradecircle.pages.circleDetail.filterMembersPlaceholder", "Filter by role or status…"),
|
|
376
388
|
className: "pl-9",
|
|
377
|
-
"aria-label": "Filter members by role or status"
|
|
389
|
+
"aria-label": n("comradecircle.pages.circleDetail.filterMembersAriaLabel", "Filter members by role or status")
|
|
378
390
|
})]
|
|
379
|
-
}), /* @__PURE__ */
|
|
391
|
+
}), /* @__PURE__ */ z("span", {
|
|
380
392
|
className: "text-sm text-text-tertiary",
|
|
381
|
-
children: s.length === o.length ?
|
|
393
|
+
children: s.length === o.length ? n("comradecircle.pages.circleDetail.memberCount", "{{count}} members", { count: x(o.length) }) : n("comradecircle.pages.circleDetail.filteredMemberCount", "{{filtered}} of {{total}}", {
|
|
394
|
+
filtered: x(s.length),
|
|
395
|
+
total: x(o.length)
|
|
396
|
+
})
|
|
382
397
|
})]
|
|
383
|
-
}), /* @__PURE__ */
|
|
398
|
+
}), /* @__PURE__ */ B("div", {
|
|
384
399
|
className: "overflow-hidden rounded-2xl border border-border-seam bg-bg-surface",
|
|
385
|
-
children: [/* @__PURE__ */
|
|
386
|
-
className:
|
|
400
|
+
children: [/* @__PURE__ */ B("div", {
|
|
401
|
+
className: p("hidden border-b border-border-seam px-5 py-3 text-xs font-semibold uppercase tracking-wide text-text-tertiary lg:grid lg:items-center lg:gap-4", l),
|
|
387
402
|
children: [
|
|
388
|
-
/* @__PURE__ */
|
|
389
|
-
/* @__PURE__ */
|
|
390
|
-
/* @__PURE__ */
|
|
391
|
-
|
|
403
|
+
/* @__PURE__ */ z("span", { children: n("comradecircle.pages.circleDetail.memberColumn", "Member") }),
|
|
404
|
+
/* @__PURE__ */ z("span", { children: n("comradecircle.pages.circleDetail.statusColumn", "Status") }),
|
|
405
|
+
/* @__PURE__ */ z("span", { children: n("comradecircle.pages.circleDetail.roleColumn", "Role") }),
|
|
406
|
+
t && /* @__PURE__ */ z("span", { children: n("comradecircle.pages.circleDetail.manageRoleColumn", "Manage role") })
|
|
392
407
|
]
|
|
393
|
-
}), s.length === 0 ? /* @__PURE__ */
|
|
408
|
+
}), s.length === 0 ? /* @__PURE__ */ z("div", {
|
|
394
409
|
className: "px-5 py-10 text-center text-sm text-text-secondary",
|
|
395
|
-
children:
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
]
|
|
400
|
-
}) : s.map((e) => /* @__PURE__ */ R("div", {
|
|
401
|
-
className: t("flex flex-col gap-3 border-b border-border-seam px-5 py-4 last:border-b-0 motion-safe:transition-colors hover:bg-bg-sunken/60 lg:grid lg:items-center lg:gap-4", l),
|
|
402
|
-
children: [/* @__PURE__ */ L(h, {
|
|
410
|
+
children: n("comradecircle.pages.circleDetail.noFilterMatches", "No members match \"{{query}}\".", { query: i.trim() })
|
|
411
|
+
}) : s.map((e) => /* @__PURE__ */ B("div", {
|
|
412
|
+
className: p("flex flex-col gap-3 border-b border-border-seam px-5 py-4 last:border-b-0 motion-safe:transition-colors hover:bg-bg-sunken/60 lg:grid lg:items-center lg:gap-4", l),
|
|
413
|
+
children: [/* @__PURE__ */ z(g, {
|
|
403
414
|
memberId: e.memberId,
|
|
404
415
|
variant: "row",
|
|
405
416
|
size: "md",
|
|
406
417
|
showPresence: !0
|
|
407
|
-
}), /* @__PURE__ */
|
|
418
|
+
}), /* @__PURE__ */ B("div", {
|
|
408
419
|
className: "flex flex-wrap items-center gap-2 lg:contents",
|
|
409
420
|
children: [
|
|
410
|
-
/* @__PURE__ */
|
|
411
|
-
/* @__PURE__ */
|
|
412
|
-
|
|
421
|
+
/* @__PURE__ */ z("div", { children: /* @__PURE__ */ z(O, { status: e.status }) }),
|
|
422
|
+
/* @__PURE__ */ z("div", { children: /* @__PURE__ */ z(O, { status: e.role }) }),
|
|
423
|
+
t && /* @__PURE__ */ B(J, {
|
|
413
424
|
value: e.role,
|
|
414
425
|
onValueChange: (t) => c(e.id, t),
|
|
415
|
-
children: [/* @__PURE__ */
|
|
426
|
+
children: [/* @__PURE__ */ z(Z, {
|
|
416
427
|
className: "h-9 w-40 lg:w-full",
|
|
417
|
-
children: /* @__PURE__ */
|
|
418
|
-
}), /* @__PURE__ */
|
|
428
|
+
children: /* @__PURE__ */ z(Q, {})
|
|
429
|
+
}), /* @__PURE__ */ z(Y, { children: $.map((e) => /* @__PURE__ */ z(X, {
|
|
419
430
|
value: e,
|
|
420
|
-
children:
|
|
431
|
+
children: b(e)
|
|
421
432
|
}, e)) })]
|
|
422
433
|
})
|
|
423
434
|
]
|
|
@@ -427,120 +438,143 @@ function Ce({ circle: e, canManage: n }) {
|
|
|
427
438
|
});
|
|
428
439
|
}
|
|
429
440
|
function we({ circle: t, isMember: n }) {
|
|
430
|
-
let { navigateTo:
|
|
431
|
-
return /* @__PURE__ */
|
|
432
|
-
/* @__PURE__ */
|
|
441
|
+
let r = f(), { navigateTo: a } = e(), { data: o, isLoading: s, isError: c, refetch: l } = i({ circleId: t.id }), [u, d] = j(!1), p = o?.items ?? [];
|
|
442
|
+
return /* @__PURE__ */ B("div", { children: [
|
|
443
|
+
/* @__PURE__ */ z("div", {
|
|
433
444
|
className: "mb-4 flex items-center justify-end",
|
|
434
|
-
children: n && /* @__PURE__ */
|
|
435
|
-
onClick: () =>
|
|
436
|
-
children: [
|
|
445
|
+
children: n && /* @__PURE__ */ B(V, {
|
|
446
|
+
onClick: () => d(!0),
|
|
447
|
+
children: [
|
|
448
|
+
/* @__PURE__ */ z(I, { className: "mr-1.5 h-4 w-4" }),
|
|
449
|
+
" ",
|
|
450
|
+
r("comradecircle.pages.circleDetail.newEvent", "New event")
|
|
451
|
+
]
|
|
437
452
|
})
|
|
438
453
|
}),
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
454
|
+
s ? /* @__PURE__ */ z(T, { label: r("comradecircle.pages.circleDetail.loadingEvents", "Loading events…") }) : c ? /* @__PURE__ */ z(w, {
|
|
455
|
+
message: r("comradecircle.pages.circleDetail.eventsError", "We couldn't load events."),
|
|
456
|
+
onRetry: () => l()
|
|
457
|
+
}) : p.length === 0 ? /* @__PURE__ */ z(C, {
|
|
458
|
+
icon: /* @__PURE__ */ z(oe, { className: "h-9 w-9" }),
|
|
459
|
+
title: r("comradecircle.pages.circleDetail.noEventsTitle", "No events scheduled"),
|
|
460
|
+
description: n ? r("comradecircle.pages.circleDetail.noEventsDescriptionMember", "Schedule the first event for this circle.") : r("comradecircle.pages.circleDetail.noEventsDescriptionNonMember", "No upcoming events."),
|
|
461
|
+
action: n ? /* @__PURE__ */ B(V, {
|
|
462
|
+
onClick: () => d(!0),
|
|
463
|
+
children: [
|
|
464
|
+
/* @__PURE__ */ z(I, { className: "mr-1.5 h-4 w-4" }),
|
|
465
|
+
" ",
|
|
466
|
+
r("comradecircle.pages.circleDetail.newEvent", "New event")
|
|
467
|
+
]
|
|
446
468
|
}) : void 0
|
|
447
|
-
}) : /* @__PURE__ */
|
|
469
|
+
}) : /* @__PURE__ */ z("div", {
|
|
448
470
|
className: "grid gap-4 md:grid-cols-2",
|
|
449
|
-
children:
|
|
471
|
+
children: p.map((e) => /* @__PURE__ */ z(ne, {
|
|
450
472
|
event: e,
|
|
451
|
-
onOpen: () =>
|
|
473
|
+
onOpen: () => a(`events/${e.id}`)
|
|
452
474
|
}, e.id))
|
|
453
475
|
}),
|
|
454
|
-
/* @__PURE__ */
|
|
476
|
+
/* @__PURE__ */ z(ie, {
|
|
455
477
|
circleId: t.id,
|
|
456
|
-
open:
|
|
457
|
-
onOpenChange:
|
|
478
|
+
open: u,
|
|
479
|
+
onOpenChange: d
|
|
458
480
|
})
|
|
459
481
|
] });
|
|
460
482
|
}
|
|
461
483
|
function Te({ circle: e, isMember: t, canManage: n }) {
|
|
462
|
-
let { data:
|
|
463
|
-
return /* @__PURE__ */
|
|
464
|
-
/* @__PURE__ */
|
|
484
|
+
let r = f(), { data: i, isLoading: a, isError: o, refetch: c } = s(e.id), [l, u] = j(!1);
|
|
485
|
+
return /* @__PURE__ */ B("div", { children: [
|
|
486
|
+
/* @__PURE__ */ z("div", {
|
|
465
487
|
className: "mb-4 flex items-center justify-end",
|
|
466
|
-
children: t && /* @__PURE__ */
|
|
467
|
-
onClick: () =>
|
|
468
|
-
children: [
|
|
488
|
+
children: t && /* @__PURE__ */ B(V, {
|
|
489
|
+
onClick: () => u(!0),
|
|
490
|
+
children: [
|
|
491
|
+
/* @__PURE__ */ z(I, { className: "mr-1.5 h-4 w-4" }),
|
|
492
|
+
" ",
|
|
493
|
+
r("comradecircle.pages.circleDetail.newPoll", "New poll")
|
|
494
|
+
]
|
|
469
495
|
})
|
|
470
496
|
}),
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
497
|
+
a ? /* @__PURE__ */ z(T, { label: r("comradecircle.pages.circleDetail.loadingPolls", "Loading polls…") }) : o ? /* @__PURE__ */ z(w, {
|
|
498
|
+
message: r("comradecircle.pages.circleDetail.pollsError", "We couldn't load polls."),
|
|
499
|
+
onRetry: () => c()
|
|
500
|
+
}) : (i ?? []).length === 0 ? /* @__PURE__ */ z(C, {
|
|
501
|
+
icon: /* @__PURE__ */ z(M, { className: "h-9 w-9" }),
|
|
502
|
+
title: r("comradecircle.pages.circleDetail.noPollsTitle", "No polls yet"),
|
|
503
|
+
description: t ? r("comradecircle.pages.circleDetail.noPollsDescriptionMember", "Ask the circle a question with a poll.") : r("comradecircle.pages.circleDetail.noPollsDescriptionNonMember", "No polls have been created."),
|
|
504
|
+
action: t ? /* @__PURE__ */ B(V, {
|
|
505
|
+
onClick: () => u(!0),
|
|
506
|
+
children: [
|
|
507
|
+
/* @__PURE__ */ z(I, { className: "mr-1.5 h-4 w-4" }),
|
|
508
|
+
" ",
|
|
509
|
+
r("comradecircle.pages.circleDetail.newPoll", "New poll")
|
|
510
|
+
]
|
|
478
511
|
}) : void 0
|
|
479
|
-
}) : /* @__PURE__ */
|
|
512
|
+
}) : /* @__PURE__ */ z("div", {
|
|
480
513
|
className: "mx-auto flex max-w-2xl flex-col gap-4",
|
|
481
|
-
children: (
|
|
514
|
+
children: (i ?? []).map((e) => /* @__PURE__ */ z(re, {
|
|
482
515
|
poll: e,
|
|
483
516
|
canManage: n
|
|
484
517
|
}, e.id))
|
|
485
518
|
}),
|
|
486
|
-
/* @__PURE__ */
|
|
519
|
+
/* @__PURE__ */ z(ke, {
|
|
487
520
|
circleId: e.id,
|
|
488
|
-
open:
|
|
489
|
-
onOpenChange:
|
|
521
|
+
open: l,
|
|
522
|
+
onOpenChange: u
|
|
490
523
|
})
|
|
491
524
|
] });
|
|
492
525
|
}
|
|
493
526
|
function Ee({ circle: e }) {
|
|
494
|
-
|
|
527
|
+
let t = f();
|
|
528
|
+
return /* @__PURE__ */ z("div", {
|
|
495
529
|
className: "mx-auto max-w-2xl",
|
|
496
|
-
children: /* @__PURE__ */
|
|
530
|
+
children: /* @__PURE__ */ B("div", {
|
|
497
531
|
className: "rounded-2xl border border-border-seam bg-bg-surface p-6",
|
|
498
532
|
children: [
|
|
499
|
-
/* @__PURE__ */
|
|
533
|
+
/* @__PURE__ */ z("h2", {
|
|
500
534
|
className: "text-lg font-semibold text-text-primary",
|
|
501
|
-
children: "About this circle"
|
|
535
|
+
children: t("comradecircle.pages.circleDetail.aboutTitle", "About this circle")
|
|
502
536
|
}),
|
|
503
|
-
/* @__PURE__ */
|
|
537
|
+
/* @__PURE__ */ z("p", {
|
|
504
538
|
className: "mt-2 whitespace-pre-wrap text-sm text-text-secondary",
|
|
505
|
-
children: e.description || "No description provided."
|
|
539
|
+
children: e.description || t("comradecircle.pages.circleDetail.noDescription", "No description provided.")
|
|
506
540
|
}),
|
|
507
|
-
e.tags.length > 0 && /* @__PURE__ */
|
|
541
|
+
e.tags.length > 0 && /* @__PURE__ */ z("div", {
|
|
508
542
|
className: "mt-4 flex flex-wrap gap-1.5",
|
|
509
|
-
children: e.tags.map((e) => /* @__PURE__ */
|
|
543
|
+
children: e.tags.map((e) => /* @__PURE__ */ B("span", {
|
|
510
544
|
className: "rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs font-medium text-text-secondary",
|
|
511
545
|
children: ["#", e]
|
|
512
546
|
}, e))
|
|
513
547
|
}),
|
|
514
|
-
/* @__PURE__ */
|
|
548
|
+
/* @__PURE__ */ B("dl", {
|
|
515
549
|
className: "mt-6 grid grid-cols-2 gap-4 text-sm",
|
|
516
550
|
children: [
|
|
517
|
-
/* @__PURE__ */
|
|
551
|
+
/* @__PURE__ */ B("div", { children: [/* @__PURE__ */ z("dt", {
|
|
518
552
|
className: "text-text-tertiary",
|
|
519
|
-
children: "Visibility"
|
|
520
|
-
}), /* @__PURE__ */
|
|
553
|
+
children: t("comradecircle.pages.circleDetail.visibilityLabel", "Visibility")
|
|
554
|
+
}), /* @__PURE__ */ z("dd", {
|
|
521
555
|
className: "mt-1 text-text-primary",
|
|
522
|
-
children:
|
|
556
|
+
children: b(e.visibility)
|
|
523
557
|
})] }),
|
|
524
|
-
/* @__PURE__ */
|
|
558
|
+
/* @__PURE__ */ B("div", { children: [/* @__PURE__ */ z("dt", {
|
|
525
559
|
className: "text-text-tertiary",
|
|
526
|
-
children: "Status"
|
|
527
|
-
}), /* @__PURE__ */
|
|
560
|
+
children: t("comradecircle.pages.circleDetail.statusLabel", "Status")
|
|
561
|
+
}), /* @__PURE__ */ z("dd", {
|
|
528
562
|
className: "mt-1 text-text-primary",
|
|
529
|
-
children:
|
|
563
|
+
children: b(e.status)
|
|
530
564
|
})] }),
|
|
531
|
-
/* @__PURE__ */
|
|
565
|
+
/* @__PURE__ */ B("div", { children: [/* @__PURE__ */ z("dt", {
|
|
532
566
|
className: "text-text-tertiary",
|
|
533
|
-
children: "Members"
|
|
534
|
-
}), /* @__PURE__ */
|
|
567
|
+
children: t("comradecircle.pages.circleDetail.membersLabel", "Members")
|
|
568
|
+
}), /* @__PURE__ */ z("dd", {
|
|
535
569
|
className: "mt-1 text-text-primary",
|
|
536
|
-
children:
|
|
570
|
+
children: x(e.memberCount)
|
|
537
571
|
})] }),
|
|
538
|
-
/* @__PURE__ */
|
|
572
|
+
/* @__PURE__ */ B("div", { children: [/* @__PURE__ */ z("dt", {
|
|
539
573
|
className: "text-text-tertiary",
|
|
540
|
-
children: "Created"
|
|
541
|
-
}), /* @__PURE__ */
|
|
574
|
+
children: t("comradecircle.pages.circleDetail.createdLabel", "Created")
|
|
575
|
+
}), /* @__PURE__ */ z("dd", {
|
|
542
576
|
className: "mt-1 text-text-primary",
|
|
543
|
-
children:
|
|
577
|
+
children: y(e.createdAt)
|
|
544
578
|
})] })
|
|
545
579
|
]
|
|
546
580
|
})
|
|
@@ -554,235 +588,239 @@ var De = [
|
|
|
554
588
|
"ANNOUNCEMENT",
|
|
555
589
|
"VOICE"
|
|
556
590
|
];
|
|
557
|
-
function
|
|
558
|
-
let a =
|
|
559
|
-
return /* @__PURE__ */
|
|
591
|
+
function Oe({ circleId: e, open: t, onOpenChange: r, onCreated: i }) {
|
|
592
|
+
let a = f(), o = n(), [s, c] = j(""), [l, u] = j(""), [d, p] = j("TEXT"), [m, h] = j(null);
|
|
593
|
+
return /* @__PURE__ */ z(pe, {
|
|
560
594
|
open: t,
|
|
561
|
-
onOpenChange:
|
|
562
|
-
children: /* @__PURE__ */
|
|
595
|
+
onOpenChange: r,
|
|
596
|
+
children: /* @__PURE__ */ B(me, {
|
|
563
597
|
className: "sm:max-w-md",
|
|
564
598
|
children: [
|
|
565
|
-
/* @__PURE__ */
|
|
566
|
-
/* @__PURE__ */
|
|
599
|
+
/* @__PURE__ */ B(K, { children: [/* @__PURE__ */ z(q, { children: a("comradecircle.pages.circleDetail.createChannelTitle", "Create a channel") }), /* @__PURE__ */ z(W, { children: a("comradecircle.pages.circleDetail.createChannelDescription", "Channels organise conversations by topic or format.") })] }),
|
|
600
|
+
/* @__PURE__ */ B("div", {
|
|
567
601
|
className: "flex flex-col gap-4 py-2",
|
|
568
602
|
children: [
|
|
569
|
-
/* @__PURE__ */
|
|
603
|
+
/* @__PURE__ */ B("div", {
|
|
570
604
|
className: "grid gap-1.5",
|
|
571
|
-
children: [/* @__PURE__ */
|
|
605
|
+
children: [/* @__PURE__ */ z(U, {
|
|
572
606
|
htmlFor: "channel-name",
|
|
573
|
-
children: "Name"
|
|
574
|
-
}), /* @__PURE__ */
|
|
607
|
+
children: a("comradecircle.pages.circleDetail.channelNameLabel", "Name")
|
|
608
|
+
}), /* @__PURE__ */ z(H, {
|
|
575
609
|
id: "channel-name",
|
|
576
|
-
value:
|
|
577
|
-
onChange: (e) =>
|
|
578
|
-
placeholder: "general"
|
|
610
|
+
value: s,
|
|
611
|
+
onChange: (e) => c(e.target.value),
|
|
612
|
+
placeholder: a("comradecircle.pages.circleDetail.channelNamePlaceholder", "general")
|
|
579
613
|
})]
|
|
580
614
|
}),
|
|
581
|
-
/* @__PURE__ */
|
|
615
|
+
/* @__PURE__ */ B("div", {
|
|
582
616
|
className: "grid gap-1.5",
|
|
583
|
-
children: [/* @__PURE__ */
|
|
584
|
-
value:
|
|
585
|
-
onValueChange: (e) =>
|
|
586
|
-
children: [/* @__PURE__ */
|
|
617
|
+
children: [/* @__PURE__ */ z(U, { children: a("comradecircle.pages.circleDetail.channelTypeLabel", "Type") }), /* @__PURE__ */ B(J, {
|
|
618
|
+
value: d,
|
|
619
|
+
onValueChange: (e) => p(e),
|
|
620
|
+
children: [/* @__PURE__ */ z(Z, { children: /* @__PURE__ */ z(Q, {}) }), /* @__PURE__ */ z(Y, { children: De.map((e) => /* @__PURE__ */ z(X, {
|
|
587
621
|
value: e,
|
|
588
|
-
children:
|
|
622
|
+
children: b(e)
|
|
589
623
|
}, e)) })]
|
|
590
624
|
})]
|
|
591
625
|
}),
|
|
592
|
-
/* @__PURE__ */
|
|
626
|
+
/* @__PURE__ */ B("div", {
|
|
593
627
|
className: "grid gap-1.5",
|
|
594
|
-
children: [/* @__PURE__ */
|
|
628
|
+
children: [/* @__PURE__ */ z(U, {
|
|
595
629
|
htmlFor: "channel-desc",
|
|
596
|
-
children: "Description"
|
|
597
|
-
}), /* @__PURE__ */
|
|
630
|
+
children: a("comradecircle.pages.circleDetail.channelDescriptionLabel", "Description")
|
|
631
|
+
}), /* @__PURE__ */ z(ge, {
|
|
598
632
|
id: "channel-desc",
|
|
599
|
-
value:
|
|
600
|
-
onChange: (e) =>
|
|
633
|
+
value: l,
|
|
634
|
+
onChange: (e) => u(e.target.value),
|
|
601
635
|
rows: 2
|
|
602
636
|
})]
|
|
603
637
|
}),
|
|
604
|
-
|
|
638
|
+
m && /* @__PURE__ */ z("p", {
|
|
605
639
|
className: "text-sm text-status-error-text",
|
|
606
|
-
children:
|
|
640
|
+
children: m
|
|
607
641
|
})
|
|
608
642
|
]
|
|
609
643
|
}),
|
|
610
|
-
/* @__PURE__ */
|
|
644
|
+
/* @__PURE__ */ B(G, { children: [/* @__PURE__ */ z(V, {
|
|
611
645
|
variant: "outline",
|
|
612
|
-
onClick: () =>
|
|
613
|
-
children: "Cancel"
|
|
614
|
-
}), /* @__PURE__ */
|
|
646
|
+
onClick: () => r(!1),
|
|
647
|
+
children: a("common.cancel", "Cancel")
|
|
648
|
+
}), /* @__PURE__ */ z(V, {
|
|
615
649
|
onClick: async () => {
|
|
616
|
-
if (!
|
|
617
|
-
|
|
650
|
+
if (!s.trim()) {
|
|
651
|
+
h(a("comradecircle.pages.circleDetail.channelNameRequired", "Channel name is required."));
|
|
618
652
|
return;
|
|
619
653
|
}
|
|
620
654
|
try {
|
|
621
|
-
let t = await
|
|
655
|
+
let t = await o.mutateAsync({
|
|
622
656
|
circleId: e,
|
|
623
|
-
name:
|
|
624
|
-
slug:
|
|
625
|
-
description:
|
|
626
|
-
type:
|
|
657
|
+
name: s.trim(),
|
|
658
|
+
slug: D(s),
|
|
659
|
+
description: l.trim() || null,
|
|
660
|
+
type: d
|
|
627
661
|
});
|
|
628
|
-
|
|
662
|
+
v.success(a("comradecircle.pages.circleDetail.channelCreated", "Channel created"), `#${t.name}`), r(!1), c(""), u(""), p("TEXT"), h(null), i?.(t);
|
|
629
663
|
} catch (e) {
|
|
630
|
-
|
|
664
|
+
h(_(e));
|
|
631
665
|
}
|
|
632
666
|
},
|
|
633
|
-
disabled:
|
|
634
|
-
children: "Create channel"
|
|
667
|
+
disabled: o.isPending,
|
|
668
|
+
children: a("comradecircle.pages.circleDetail.createChannelAction", "Create channel")
|
|
635
669
|
})] })
|
|
636
670
|
]
|
|
637
671
|
})
|
|
638
672
|
});
|
|
639
673
|
}
|
|
640
|
-
function
|
|
641
|
-
let
|
|
674
|
+
function ke({ circleId: e, open: t, onOpenChange: n }) {
|
|
675
|
+
let i = f(), a = r(), [o, s] = j(""), [c, l] = j(["", ""]), [u, d] = j(!1), [p, m] = j(!1), [h, g] = j(""), [y, b] = j(null), x = A(() => {
|
|
642
676
|
let e = /* @__PURE__ */ new Date();
|
|
643
677
|
return e.setMinutes(e.getMinutes() - e.getTimezoneOffset()), e.toISOString().slice(0, 16);
|
|
644
|
-
}, []),
|
|
645
|
-
|
|
678
|
+
}, []), S = () => {
|
|
679
|
+
s(""), l(["", ""]), d(!1), m(!1), g(""), b(null);
|
|
646
680
|
};
|
|
647
|
-
return /* @__PURE__ */
|
|
681
|
+
return /* @__PURE__ */ z(pe, {
|
|
648
682
|
open: t,
|
|
649
683
|
onOpenChange: n,
|
|
650
|
-
children: /* @__PURE__ */
|
|
684
|
+
children: /* @__PURE__ */ B(me, {
|
|
651
685
|
className: "sm:max-w-md",
|
|
652
686
|
children: [
|
|
653
|
-
/* @__PURE__ */
|
|
654
|
-
/* @__PURE__ */
|
|
687
|
+
/* @__PURE__ */ B(K, { children: [/* @__PURE__ */ z(q, { children: i("comradecircle.pages.circleDetail.createPollTitle", "Create a poll") }), /* @__PURE__ */ z(W, { children: i("comradecircle.pages.circleDetail.createPollDescription", "Gather the circle's opinion.") })] }),
|
|
688
|
+
/* @__PURE__ */ B("div", {
|
|
655
689
|
className: "flex flex-col gap-4 py-2",
|
|
656
690
|
children: [
|
|
657
|
-
/* @__PURE__ */
|
|
691
|
+
/* @__PURE__ */ B("div", {
|
|
658
692
|
className: "grid gap-1.5",
|
|
659
|
-
children: [/* @__PURE__ */
|
|
693
|
+
children: [/* @__PURE__ */ z(U, {
|
|
660
694
|
htmlFor: "poll-q",
|
|
661
|
-
children: "Question"
|
|
662
|
-
}), /* @__PURE__ */
|
|
695
|
+
children: i("comradecircle.pages.circleDetail.pollQuestionLabel", "Question")
|
|
696
|
+
}), /* @__PURE__ */ z(H, {
|
|
663
697
|
id: "poll-q",
|
|
664
|
-
value:
|
|
665
|
-
onChange: (e) =>
|
|
666
|
-
placeholder: "What should we build next?"
|
|
698
|
+
value: o,
|
|
699
|
+
onChange: (e) => s(e.target.value),
|
|
700
|
+
placeholder: i("comradecircle.pages.circleDetail.pollQuestionPlaceholder", "What should we build next?")
|
|
667
701
|
})]
|
|
668
702
|
}),
|
|
669
|
-
/* @__PURE__ */
|
|
703
|
+
/* @__PURE__ */ B("div", {
|
|
670
704
|
className: "grid gap-1.5",
|
|
671
|
-
children: [/* @__PURE__ */
|
|
705
|
+
children: [/* @__PURE__ */ z(U, { children: i("comradecircle.pages.circleDetail.pollOptionsLabel", "Options") }), /* @__PURE__ */ B("div", {
|
|
672
706
|
className: "flex flex-col gap-2",
|
|
673
|
-
children: [
|
|
707
|
+
children: [c.map((e, t) => /* @__PURE__ */ B("div", {
|
|
674
708
|
className: "flex items-center gap-2",
|
|
675
|
-
children: [/* @__PURE__ */
|
|
709
|
+
children: [/* @__PURE__ */ z(H, {
|
|
676
710
|
value: e,
|
|
677
|
-
onChange: (e) =>
|
|
678
|
-
placeholder:
|
|
679
|
-
}),
|
|
711
|
+
onChange: (e) => l((n) => n.map((n, r) => r === t ? e.target.value : n)),
|
|
712
|
+
placeholder: i("comradecircle.pages.circleDetail.pollOptionPlaceholder", "Option {{number}}", { number: t + 1 })
|
|
713
|
+
}), c.length > 2 && /* @__PURE__ */ z(V, {
|
|
680
714
|
variant: "ghost",
|
|
681
715
|
size: "icon",
|
|
682
|
-
onClick: () =>
|
|
683
|
-
"aria-label":
|
|
716
|
+
onClick: () => l((e) => e.filter((e, n) => n !== t)),
|
|
717
|
+
"aria-label": i("comradecircle.pages.circleDetail.removeOptionAriaLabel", "Remove option {{number}}", { number: t + 1 }),
|
|
684
718
|
children: "✕"
|
|
685
719
|
})]
|
|
686
|
-
}, t)),
|
|
720
|
+
}, t)), c.length < 8 && /* @__PURE__ */ B(V, {
|
|
687
721
|
variant: "outline",
|
|
688
722
|
size: "sm",
|
|
689
|
-
onClick: () =>
|
|
690
|
-
children: [
|
|
723
|
+
onClick: () => l((e) => [...e, ""]),
|
|
724
|
+
children: [
|
|
725
|
+
/* @__PURE__ */ z(I, { className: "mr-1.5 h-4 w-4" }),
|
|
726
|
+
" ",
|
|
727
|
+
i("comradecircle.pages.circleDetail.addOption", "Add option")
|
|
728
|
+
]
|
|
691
729
|
})]
|
|
692
730
|
})]
|
|
693
731
|
}),
|
|
694
|
-
/* @__PURE__ */
|
|
732
|
+
/* @__PURE__ */ B("div", {
|
|
695
733
|
className: "grid gap-1.5",
|
|
696
734
|
children: [
|
|
697
|
-
/* @__PURE__ */
|
|
735
|
+
/* @__PURE__ */ z(U, {
|
|
698
736
|
htmlFor: "poll-closes",
|
|
699
|
-
children: "Closes at"
|
|
737
|
+
children: i("comradecircle.pages.circleDetail.pollClosesLabel", "Closes at")
|
|
700
738
|
}),
|
|
701
|
-
/* @__PURE__ */
|
|
739
|
+
/* @__PURE__ */ z(H, {
|
|
702
740
|
id: "poll-closes",
|
|
703
741
|
type: "datetime-local",
|
|
704
|
-
min:
|
|
705
|
-
value:
|
|
706
|
-
onChange: (e) =>
|
|
742
|
+
min: x,
|
|
743
|
+
value: h,
|
|
744
|
+
onChange: (e) => g(e.target.value)
|
|
707
745
|
}),
|
|
708
|
-
/* @__PURE__ */
|
|
746
|
+
/* @__PURE__ */ z("p", {
|
|
709
747
|
className: "text-xs text-text-tertiary",
|
|
710
|
-
children: "Optional — leave empty to keep voting open indefinitely."
|
|
748
|
+
children: i("comradecircle.pages.circleDetail.pollClosesHint", "Optional — leave empty to keep voting open indefinitely.")
|
|
711
749
|
})
|
|
712
750
|
]
|
|
713
751
|
}),
|
|
714
|
-
/* @__PURE__ */
|
|
752
|
+
/* @__PURE__ */ B("div", {
|
|
715
753
|
className: "flex flex-col divide-y divide-border-seam rounded-xl border border-border-seam",
|
|
716
|
-
children: [/* @__PURE__ */
|
|
754
|
+
children: [/* @__PURE__ */ B("div", {
|
|
717
755
|
className: "flex items-center justify-between gap-4 px-3 py-3",
|
|
718
|
-
children: [/* @__PURE__ */
|
|
756
|
+
children: [/* @__PURE__ */ B("div", {
|
|
719
757
|
className: "min-w-0",
|
|
720
|
-
children: [/* @__PURE__ */
|
|
758
|
+
children: [/* @__PURE__ */ z(U, {
|
|
721
759
|
htmlFor: "poll-multi",
|
|
722
|
-
children: "Allow multiple choices"
|
|
723
|
-
}), /* @__PURE__ */
|
|
760
|
+
children: i("comradecircle.pages.circleDetail.pollMultiLabel", "Allow multiple choices")
|
|
761
|
+
}), /* @__PURE__ */ z("p", {
|
|
724
762
|
className: "text-xs text-text-tertiary",
|
|
725
|
-
children: "Let voters pick more than one option."
|
|
763
|
+
children: i("comradecircle.pages.circleDetail.pollMultiHint", "Let voters pick more than one option.")
|
|
726
764
|
})]
|
|
727
|
-
}), /* @__PURE__ */
|
|
765
|
+
}), /* @__PURE__ */ z(he, {
|
|
728
766
|
id: "poll-multi",
|
|
729
|
-
checked:
|
|
730
|
-
onCheckedChange:
|
|
767
|
+
checked: u,
|
|
768
|
+
onCheckedChange: d
|
|
731
769
|
})]
|
|
732
|
-
}), /* @__PURE__ */
|
|
770
|
+
}), /* @__PURE__ */ B("div", {
|
|
733
771
|
className: "flex items-center justify-between gap-4 px-3 py-3",
|
|
734
|
-
children: [/* @__PURE__ */
|
|
772
|
+
children: [/* @__PURE__ */ B("div", {
|
|
735
773
|
className: "min-w-0",
|
|
736
|
-
children: [/* @__PURE__ */
|
|
774
|
+
children: [/* @__PURE__ */ z(U, {
|
|
737
775
|
htmlFor: "poll-anon",
|
|
738
|
-
children: "Anonymous voting"
|
|
739
|
-
}), /* @__PURE__ */
|
|
776
|
+
children: i("comradecircle.pages.circleDetail.pollAnonymousLabel", "Anonymous voting")
|
|
777
|
+
}), /* @__PURE__ */ z("p", {
|
|
740
778
|
className: "text-xs text-text-tertiary",
|
|
741
|
-
children: "Hide who voted for each option."
|
|
779
|
+
children: i("comradecircle.pages.circleDetail.pollAnonymousHint", "Hide who voted for each option.")
|
|
742
780
|
})]
|
|
743
|
-
}), /* @__PURE__ */
|
|
781
|
+
}), /* @__PURE__ */ z(he, {
|
|
744
782
|
id: "poll-anon",
|
|
745
|
-
checked:
|
|
746
|
-
onCheckedChange:
|
|
783
|
+
checked: p,
|
|
784
|
+
onCheckedChange: m
|
|
747
785
|
})]
|
|
748
786
|
})]
|
|
749
787
|
}),
|
|
750
|
-
|
|
788
|
+
y && /* @__PURE__ */ z("p", {
|
|
751
789
|
className: "text-sm text-status-error-text",
|
|
752
|
-
children:
|
|
790
|
+
children: y
|
|
753
791
|
})
|
|
754
792
|
]
|
|
755
793
|
}),
|
|
756
|
-
/* @__PURE__ */
|
|
794
|
+
/* @__PURE__ */ B(G, { children: [/* @__PURE__ */ z(V, {
|
|
757
795
|
variant: "outline",
|
|
758
796
|
onClick: () => n(!1),
|
|
759
|
-
children: "Cancel"
|
|
760
|
-
}), /* @__PURE__ */
|
|
797
|
+
children: i("common.cancel", "Cancel")
|
|
798
|
+
}), /* @__PURE__ */ z(V, {
|
|
761
799
|
onClick: async () => {
|
|
762
|
-
let t =
|
|
763
|
-
if (!
|
|
764
|
-
|
|
800
|
+
let t = c.map((e) => e.trim()).filter(Boolean);
|
|
801
|
+
if (!o.trim()) {
|
|
802
|
+
b(i("comradecircle.pages.circleDetail.pollQuestionRequired", "A question is required."));
|
|
765
803
|
return;
|
|
766
804
|
}
|
|
767
805
|
if (t.length < 2) {
|
|
768
|
-
|
|
806
|
+
b(i("comradecircle.pages.circleDetail.pollOptionsRequired", "Add at least two options."));
|
|
769
807
|
return;
|
|
770
808
|
}
|
|
771
809
|
try {
|
|
772
|
-
await
|
|
810
|
+
await a.mutateAsync({
|
|
773
811
|
circleId: e,
|
|
774
|
-
question:
|
|
812
|
+
question: o.trim(),
|
|
775
813
|
options: t,
|
|
776
|
-
allowMultiple:
|
|
777
|
-
isAnonymous:
|
|
778
|
-
closesAt:
|
|
779
|
-
}),
|
|
814
|
+
allowMultiple: u,
|
|
815
|
+
isAnonymous: p,
|
|
816
|
+
closesAt: h ? new Date(h).toISOString() : null
|
|
817
|
+
}), v.success(i("comradecircle.pages.circleDetail.pollCreated", "Poll created")), n(!1), S();
|
|
780
818
|
} catch (e) {
|
|
781
|
-
|
|
819
|
+
b(_(e));
|
|
782
820
|
}
|
|
783
821
|
},
|
|
784
|
-
disabled:
|
|
785
|
-
children: "Create poll"
|
|
822
|
+
disabled: a.isPending,
|
|
823
|
+
children: i("comradecircle.pages.circleDetail.createPollAction", "Create poll")
|
|
786
824
|
})] })
|
|
787
825
|
]
|
|
788
826
|
})
|