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