@burdenoff/microfe-comradecircle 2026.525.1 → 2026.704.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/comradecircle/ComradeCircleRoot.js +75 -95
- package/dist/comradecircle/ComradeCircleRoot.js.map +1 -1
- package/dist/comradecircle/ComradeCircleRoutes.js +58 -37
- package/dist/comradecircle/ComradeCircleRoutes.js.map +1 -1
- package/dist/comradecircle/components/Avatar.js +47 -0
- package/dist/comradecircle/components/Avatar.js.map +1 -0
- package/dist/comradecircle/components/AvatarUploadField.js +80 -0
- package/dist/comradecircle/components/AvatarUploadField.js.map +1 -0
- package/dist/comradecircle/components/CircleCard.js +118 -0
- package/dist/comradecircle/components/CircleCard.js.map +1 -0
- package/dist/comradecircle/components/CommentThread.js +105 -0
- package/dist/comradecircle/components/CommentThread.js.map +1 -0
- package/dist/comradecircle/components/CreateCircleDialog.js +159 -0
- package/dist/comradecircle/components/CreateCircleDialog.js.map +1 -0
- package/dist/comradecircle/components/CreateEventDialog.js +210 -0
- package/dist/comradecircle/components/CreateEventDialog.js.map +1 -0
- package/dist/comradecircle/components/EmptyState.js +35 -0
- package/dist/comradecircle/components/EmptyState.js.map +1 -0
- package/dist/comradecircle/components/EventCard.js +93 -0
- package/dist/comradecircle/components/EventCard.js.map +1 -0
- package/dist/comradecircle/components/FileImage.js +20 -0
- package/dist/comradecircle/components/FileImage.js.map +1 -0
- package/dist/comradecircle/components/FilterTabs.js +27 -0
- package/dist/comradecircle/components/FilterTabs.js.map +1 -0
- package/dist/comradecircle/components/ImageAttachments.js +97 -0
- package/dist/comradecircle/components/ImageAttachments.js.map +1 -0
- package/dist/comradecircle/components/MemberIdentity.js +44 -0
- package/dist/comradecircle/components/MemberIdentity.js.map +1 -0
- package/dist/comradecircle/components/MiniBar.js +22 -0
- package/dist/comradecircle/components/MiniBar.js.map +1 -0
- package/dist/comradecircle/components/PageLayout.js +38 -0
- package/dist/comradecircle/components/PageLayout.js.map +1 -0
- package/dist/comradecircle/components/Pagination.js +50 -0
- package/dist/comradecircle/components/Pagination.js.map +1 -0
- package/dist/comradecircle/components/PollCard.js +97 -0
- package/dist/comradecircle/components/PollCard.js.map +1 -0
- package/dist/comradecircle/components/PostCard.js +163 -0
- package/dist/comradecircle/components/PostCard.js.map +1 -0
- package/dist/comradecircle/components/PostComposer.js +87 -0
- package/dist/comradecircle/components/PostComposer.js.map +1 -0
- package/dist/comradecircle/components/ReactionBar.js +122 -0
- package/dist/comradecircle/components/ReactionBar.js.map +1 -0
- package/dist/comradecircle/components/StateViews.js +49 -0
- package/dist/comradecircle/components/StateViews.js.map +1 -0
- package/dist/comradecircle/components/StatusBadge.js +68 -0
- package/dist/comradecircle/components/StatusBadge.js.map +1 -0
- package/dist/comradecircle/components/Tabs.js +31 -0
- package/dist/comradecircle/components/Tabs.js.map +1 -0
- package/dist/comradecircle/components/TagInput.js +49 -0
- package/dist/comradecircle/components/TagInput.js.map +1 -0
- package/dist/comradecircle/context/ComradeCircleContext.js +85 -0
- package/dist/comradecircle/context/ComradeCircleContext.js.map +1 -0
- package/dist/comradecircle/context/index.js +1 -0
- package/dist/comradecircle/hooks/index.js +3 -0
- package/dist/comradecircle/hooks/useComradeCircleApi.js +419 -0
- package/dist/comradecircle/hooks/useComradeCircleApi.js.map +1 -0
- package/dist/comradecircle/hooks/useCursorPager.js +25 -0
- package/dist/comradecircle/hooks/useCursorPager.js.map +1 -0
- package/dist/comradecircle/hooks/useFiles.js +78 -0
- package/dist/comradecircle/hooks/useFiles.js.map +1 -0
- package/dist/comradecircle/index.js +5 -2
- package/dist/comradecircle/lib/graphql-cache.js +9 -0
- package/dist/comradecircle/lib/graphql-cache.js.map +1 -0
- package/dist/comradecircle/lib/toast.js +39 -0
- package/dist/comradecircle/lib/toast.js.map +1 -0
- package/dist/comradecircle/pages/FeedPage.js +65 -0
- package/dist/comradecircle/pages/FeedPage.js.map +1 -0
- package/dist/comradecircle/pages/circles/CircleDetailPage.js +651 -0
- package/dist/comradecircle/pages/circles/CircleDetailPage.js.map +1 -0
- package/dist/comradecircle/pages/circles/CirclesPage.js +129 -0
- package/dist/comradecircle/pages/circles/CirclesPage.js.map +1 -0
- package/dist/comradecircle/pages/events/EventDetailPage.js +276 -0
- package/dist/comradecircle/pages/events/EventDetailPage.js.map +1 -0
- package/dist/comradecircle/pages/events/EventsPage.js +102 -0
- package/dist/comradecircle/pages/events/EventsPage.js.map +1 -0
- package/dist/comradecircle/pages/members/MemberProfilePage.js +138 -0
- package/dist/comradecircle/pages/members/MemberProfilePage.js.map +1 -0
- package/dist/comradecircle/pages/members/MembersPage.js +153 -0
- package/dist/comradecircle/pages/members/MembersPage.js.map +1 -0
- package/dist/comradecircle/pages/profile/MyProfilePage.js +266 -0
- package/dist/comradecircle/pages/profile/MyProfilePage.js.map +1 -0
- package/dist/comradecircle/utils/cn.js +10 -0
- package/dist/comradecircle/utils/cn.js.map +1 -0
- package/dist/comradecircle/utils/formatters.js +51 -0
- package/dist/comradecircle/utils/formatters.js.map +1 -0
- package/dist/comradecircle/utils/navigation.js +2 -1
- package/dist/comradecircle/utils/navigation.js.map +1 -1
- package/dist/comradecircle/utils/slug.js +8 -0
- package/dist/comradecircle/utils/slug.js.map +1 -0
- package/dist/index.js +6 -4
- package/dist/node_modules/clsx/dist/clsx.js +18 -0
- package/dist/node_modules/clsx/dist/clsx.js.map +1 -0
- package/dist/node_modules/sonner/dist/index.js +163 -0
- package/dist/node_modules/sonner/dist/index.js.map +1 -0
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +1716 -0
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -0
- package/package.json +3 -2
- package/dist/comradecircle/pages/CommunitiesPage.js +0 -299
- package/dist/comradecircle/pages/CommunitiesPage.js.map +0 -1
- package/dist/comradecircle/pages/CreatorPage.js +0 -399
- package/dist/comradecircle/pages/CreatorPage.js.map +0 -1
- package/dist/comradecircle/pages/DashboardPage.js +0 -265
- package/dist/comradecircle/pages/DashboardPage.js.map +0 -1
- package/dist/comradecircle/providers/ComradeCircleProvider.js +0 -27
- package/dist/comradecircle/providers/ComradeCircleProvider.js.map +0 -1
- package/dist/comradecircle/store/comradecircleStore.js +0 -345
- package/dist/comradecircle/store/comradecircleStore.js.map +0 -1
|
@@ -0,0 +1,651 @@
|
|
|
1
|
+
import { useComradeCircle as e } from "../../context/ComradeCircleContext.js";
|
|
2
|
+
import { cn as t } from "../../utils/cn.js";
|
|
3
|
+
import { PageLayout as n } from "../../components/PageLayout.js";
|
|
4
|
+
import "../../context/index.js";
|
|
5
|
+
import { useComCircle as r, useComCreateChannel as i, useComCreatePoll as a, useComEvents as o, useComJoinCircle as s, useComLeaveCircle as c, useComPolls as l, useComPosts as u, useComSetMemberRole as d } from "../../hooks/useComradeCircleApi.js";
|
|
6
|
+
import { useCursorPager as f } from "../../hooks/useCursorPager.js";
|
|
7
|
+
import "../../hooks/index.js";
|
|
8
|
+
import { Avatar as p } from "../../components/Avatar.js";
|
|
9
|
+
import { MemberIdentity as m } from "../../components/MemberIdentity.js";
|
|
10
|
+
import { describeError as h, notify as g } from "../../lib/toast.js";
|
|
11
|
+
import { formatDate as _, formatEnumLabel as v, formatNumber as y } from "../../utils/formatters.js";
|
|
12
|
+
import { PostCard as b } from "../../components/PostCard.js";
|
|
13
|
+
import { EmptyState as x } from "../../components/EmptyState.js";
|
|
14
|
+
import { ErrorView as S, LoadingView as C } from "../../components/StateViews.js";
|
|
15
|
+
import { Pagination as w } from "../../components/Pagination.js";
|
|
16
|
+
import { slugify as T } from "../../utils/slug.js";
|
|
17
|
+
import { StatusBadge as E } from "../../components/StatusBadge.js";
|
|
18
|
+
import { Tabs as ee } from "../../components/Tabs.js";
|
|
19
|
+
import { PostComposer as D } from "../../components/PostComposer.js";
|
|
20
|
+
import { EventCard as te } from "../../components/EventCard.js";
|
|
21
|
+
import { PollCard as ne } from "../../components/PollCard.js";
|
|
22
|
+
import { CreateEventDialog as re } from "../../components/CreateEventDialog.js";
|
|
23
|
+
import { useMemo as O, useState as k } from "react";
|
|
24
|
+
import { ArrowLeft as ie, BarChart3 as A, CalendarDays as j, Hash as M, Info as ae, Megaphone as oe, MessageCircle as se, MessagesSquare as ce, Mic as le, Plus as N, Users as P } from "lucide-react";
|
|
25
|
+
import { useParams as ue } from "react-router-dom";
|
|
26
|
+
import { Fragment as de, jsx as F, jsxs as I } from "react/jsx-runtime";
|
|
27
|
+
import { Button as L, Input as R, Label as z, ResponsiveDialog as B, ResponsiveDialogContent as V, ResponsiveDialogDescription as H, ResponsiveDialogFooter as U, ResponsiveDialogHeader as W, ResponsiveDialogTitle as G, Select as K, SelectContent as q, SelectItem as J, SelectTrigger as Y, SelectValue as X, Textarea as fe } from "@burdenoff/fe-libs/ui";
|
|
28
|
+
//#region src/comradecircle/pages/circles/CircleDetailPage.tsx
|
|
29
|
+
var Z = {
|
|
30
|
+
TEXT: M,
|
|
31
|
+
FORUM: ce,
|
|
32
|
+
ANNOUNCEMENT: oe,
|
|
33
|
+
VOICE: le
|
|
34
|
+
}, pe = ["OWNER", "ADMIN"], Q = [
|
|
35
|
+
"OWNER",
|
|
36
|
+
"ADMIN",
|
|
37
|
+
"MODERATOR",
|
|
38
|
+
"MEMBER"
|
|
39
|
+
], me = 15;
|
|
40
|
+
function he() {
|
|
41
|
+
let { id: t } = ue(), { currentUser: i, navigateTo: a } = e(), { data: o, isLoading: l, isError: u, refetch: d } = r(t), f = s(), m = c(), [_, v] = k("channels"), b = O(() => o?.memberships?.find((e) => e.memberId === i?.id && e.status === "ACTIVE"), [o, i]), x = !!b, w = b ? pe.includes(b.role) : !1;
|
|
42
|
+
if (l) return /* @__PURE__ */ F(n, {
|
|
43
|
+
title: "Circle",
|
|
44
|
+
children: /* @__PURE__ */ F(C, { label: "Loading circle…" })
|
|
45
|
+
});
|
|
46
|
+
if (u || !o) return /* @__PURE__ */ F(n, {
|
|
47
|
+
title: "Circle",
|
|
48
|
+
children: /* @__PURE__ */ F(S, {
|
|
49
|
+
title: "Circle not found",
|
|
50
|
+
message: "This circle may have been archived or you may not have access.",
|
|
51
|
+
onRetry: () => d()
|
|
52
|
+
})
|
|
53
|
+
});
|
|
54
|
+
let T = o.memberships?.filter((e) => e.status === "ACTIVE") ?? [], D = [
|
|
55
|
+
{
|
|
56
|
+
value: "channels",
|
|
57
|
+
label: "Channels",
|
|
58
|
+
icon: /* @__PURE__ */ F(M, { className: "h-4 w-4" }),
|
|
59
|
+
count: o.channels?.length ?? 0
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
value: "members",
|
|
63
|
+
label: "Members",
|
|
64
|
+
icon: /* @__PURE__ */ F(P, { className: "h-4 w-4" }),
|
|
65
|
+
count: T.length
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
value: "events",
|
|
69
|
+
label: "Events",
|
|
70
|
+
icon: /* @__PURE__ */ F(j, { className: "h-4 w-4" })
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
value: "polls",
|
|
74
|
+
label: "Polls",
|
|
75
|
+
icon: /* @__PURE__ */ F(A, { className: "h-4 w-4" })
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
value: "about",
|
|
79
|
+
label: "About",
|
|
80
|
+
icon: /* @__PURE__ */ F(ae, { className: "h-4 w-4" })
|
|
81
|
+
}
|
|
82
|
+
];
|
|
83
|
+
return /* @__PURE__ */ I(n, {
|
|
84
|
+
title: /* @__PURE__ */ I("span", {
|
|
85
|
+
className: "flex items-center gap-3",
|
|
86
|
+
children: [/* @__PURE__ */ F(p, {
|
|
87
|
+
name: o.name,
|
|
88
|
+
size: "md",
|
|
89
|
+
fileId: o.avatar?.id
|
|
90
|
+
}), o.name]
|
|
91
|
+
}),
|
|
92
|
+
description: o.topic ?? void 0,
|
|
93
|
+
actions: /* @__PURE__ */ I("div", {
|
|
94
|
+
className: "flex items-center gap-2",
|
|
95
|
+
children: [/* @__PURE__ */ I(L, {
|
|
96
|
+
variant: "ghost",
|
|
97
|
+
size: "sm",
|
|
98
|
+
onClick: () => a("circles"),
|
|
99
|
+
children: [/* @__PURE__ */ F(ie, { className: "mr-1.5 h-4 w-4" }), " Back"]
|
|
100
|
+
}), x ? /* @__PURE__ */ F(L, {
|
|
101
|
+
variant: "outline",
|
|
102
|
+
onClick: () => m.mutateAsync(o.id).then(() => g.success("Left circle")).catch((e) => g.error("Could not leave", h(e))),
|
|
103
|
+
disabled: m.isPending,
|
|
104
|
+
children: "Leave"
|
|
105
|
+
}) : o.status === "ACTIVE" ? /* @__PURE__ */ F(L, {
|
|
106
|
+
onClick: () => f.mutateAsync(o.id).then(() => g.success("Joined circle")).catch((e) => g.error("Could not join", h(e))),
|
|
107
|
+
disabled: f.isPending,
|
|
108
|
+
children: "Join circle"
|
|
109
|
+
}) : null]
|
|
110
|
+
}),
|
|
111
|
+
children: [
|
|
112
|
+
/* @__PURE__ */ I("div", {
|
|
113
|
+
className: "mb-4 flex flex-wrap items-center gap-2",
|
|
114
|
+
children: [
|
|
115
|
+
/* @__PURE__ */ F(E, { status: o.visibility }),
|
|
116
|
+
o.status !== "ACTIVE" && /* @__PURE__ */ F(E, { status: o.status }),
|
|
117
|
+
b && /* @__PURE__ */ F(E, { status: b.role }),
|
|
118
|
+
/* @__PURE__ */ I("span", {
|
|
119
|
+
className: "inline-flex items-center gap-1 text-sm text-text-tertiary",
|
|
120
|
+
children: [
|
|
121
|
+
/* @__PURE__ */ F(P, { className: "h-4 w-4" }),
|
|
122
|
+
" ",
|
|
123
|
+
y(o.memberCount),
|
|
124
|
+
" members"
|
|
125
|
+
]
|
|
126
|
+
})
|
|
127
|
+
]
|
|
128
|
+
}),
|
|
129
|
+
/* @__PURE__ */ F(ee, {
|
|
130
|
+
items: D,
|
|
131
|
+
value: _,
|
|
132
|
+
onChange: v,
|
|
133
|
+
className: "mb-5"
|
|
134
|
+
}),
|
|
135
|
+
_ === "channels" && /* @__PURE__ */ F(ge, {
|
|
136
|
+
circle: o,
|
|
137
|
+
isMember: x,
|
|
138
|
+
canManage: w
|
|
139
|
+
}),
|
|
140
|
+
_ === "members" && /* @__PURE__ */ F(ve, {
|
|
141
|
+
circle: o,
|
|
142
|
+
canManage: w
|
|
143
|
+
}),
|
|
144
|
+
_ === "events" && /* @__PURE__ */ F(ye, {
|
|
145
|
+
circle: o,
|
|
146
|
+
isMember: x
|
|
147
|
+
}),
|
|
148
|
+
_ === "polls" && /* @__PURE__ */ F(be, {
|
|
149
|
+
circle: o,
|
|
150
|
+
isMember: x,
|
|
151
|
+
canManage: w
|
|
152
|
+
}),
|
|
153
|
+
_ === "about" && /* @__PURE__ */ F(xe, { circle: o })
|
|
154
|
+
]
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
function ge({ circle: e, isMember: n, canManage: r }) {
|
|
158
|
+
let i = O(() => [...e.channels ?? []].sort((e, t) => e.position - t.position), [e.channels]), [a, o] = k(i[0]?.id), [s, c] = k(!1), l = i.find((e) => e.id === a) ?? i[0];
|
|
159
|
+
return i.length === 0 ? /* @__PURE__ */ I(de, { children: [/* @__PURE__ */ F(x, {
|
|
160
|
+
icon: /* @__PURE__ */ F(M, { className: "h-10 w-10" }),
|
|
161
|
+
title: "No channels yet",
|
|
162
|
+
description: r ? "Create the first channel to start conversations in this circle." : "This circle has no channels yet. Check back soon.",
|
|
163
|
+
action: r ? /* @__PURE__ */ I(L, {
|
|
164
|
+
onClick: () => c(!0),
|
|
165
|
+
children: [/* @__PURE__ */ F(N, { className: "mr-1.5 h-4 w-4" }), " New channel"]
|
|
166
|
+
}) : void 0
|
|
167
|
+
}), /* @__PURE__ */ F($, {
|
|
168
|
+
circleId: e.id,
|
|
169
|
+
open: s,
|
|
170
|
+
onOpenChange: c,
|
|
171
|
+
onCreated: (e) => o(e.id)
|
|
172
|
+
})] }) : /* @__PURE__ */ I("div", {
|
|
173
|
+
className: "grid gap-5 lg:grid-cols-[220px_1fr]",
|
|
174
|
+
children: [
|
|
175
|
+
/* @__PURE__ */ I("aside", {
|
|
176
|
+
className: "hidden lg:block",
|
|
177
|
+
children: [/* @__PURE__ */ I("div", {
|
|
178
|
+
className: "mb-2 flex items-center justify-between",
|
|
179
|
+
children: [/* @__PURE__ */ F("h3", {
|
|
180
|
+
className: "text-xs font-semibold uppercase tracking-wide text-text-tertiary",
|
|
181
|
+
children: "Channels"
|
|
182
|
+
}), r && /* @__PURE__ */ F("button", {
|
|
183
|
+
type: "button",
|
|
184
|
+
onClick: () => c(!0),
|
|
185
|
+
"aria-label": "New channel",
|
|
186
|
+
className: "rounded-md p-1 text-text-tertiary hover:bg-bg-sunken hover:text-text-primary",
|
|
187
|
+
children: /* @__PURE__ */ F(N, { className: "h-4 w-4" })
|
|
188
|
+
})]
|
|
189
|
+
}), /* @__PURE__ */ F("nav", {
|
|
190
|
+
className: "flex flex-col gap-0.5",
|
|
191
|
+
children: i.map((e) => {
|
|
192
|
+
let n = Z[e.type];
|
|
193
|
+
return /* @__PURE__ */ I("button", {
|
|
194
|
+
type: "button",
|
|
195
|
+
onClick: () => o(e.id),
|
|
196
|
+
className: t("flex items-center gap-2 rounded-lg px-2.5 py-1.5 text-left text-sm transition-colors", e.id === l?.id ? "bg-[var(--color-accent-soft)] font-medium text-text-primary" : "text-text-secondary hover:bg-bg-sunken hover:text-text-primary"),
|
|
197
|
+
children: [/* @__PURE__ */ F(n, { className: "h-4 w-4 shrink-0 text-text-tertiary" }), /* @__PURE__ */ F("span", {
|
|
198
|
+
className: "truncate",
|
|
199
|
+
children: e.name
|
|
200
|
+
})]
|
|
201
|
+
}, e.id);
|
|
202
|
+
})
|
|
203
|
+
})]
|
|
204
|
+
}),
|
|
205
|
+
/* @__PURE__ */ F("div", {
|
|
206
|
+
className: "lg:hidden",
|
|
207
|
+
children: /* @__PURE__ */ I("div", {
|
|
208
|
+
className: "flex items-center gap-2",
|
|
209
|
+
children: [/* @__PURE__ */ I(K, {
|
|
210
|
+
value: l?.id,
|
|
211
|
+
onValueChange: o,
|
|
212
|
+
children: [/* @__PURE__ */ F(Y, { children: /* @__PURE__ */ F(X, { placeholder: "Select a channel" }) }), /* @__PURE__ */ F(q, { children: i.map((e) => /* @__PURE__ */ I(J, {
|
|
213
|
+
value: e.id,
|
|
214
|
+
children: ["#", e.name]
|
|
215
|
+
}, e.id)) })]
|
|
216
|
+
}), r && /* @__PURE__ */ F(L, {
|
|
217
|
+
variant: "outline",
|
|
218
|
+
size: "icon",
|
|
219
|
+
onClick: () => c(!0),
|
|
220
|
+
"aria-label": "New channel",
|
|
221
|
+
children: /* @__PURE__ */ F(N, { className: "h-4 w-4" })
|
|
222
|
+
})]
|
|
223
|
+
})
|
|
224
|
+
}),
|
|
225
|
+
/* @__PURE__ */ F("div", {
|
|
226
|
+
className: "min-w-0",
|
|
227
|
+
children: l && /* @__PURE__ */ F(_e, {
|
|
228
|
+
channel: l,
|
|
229
|
+
canPost: n
|
|
230
|
+
})
|
|
231
|
+
}),
|
|
232
|
+
/* @__PURE__ */ F($, {
|
|
233
|
+
circleId: e.id,
|
|
234
|
+
open: s,
|
|
235
|
+
onOpenChange: c,
|
|
236
|
+
onCreated: (e) => o(e.id)
|
|
237
|
+
})
|
|
238
|
+
]
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
function _e({ channel: e, canPost: t }) {
|
|
242
|
+
let n = f(), { data: r, isLoading: i, isError: a, refetch: o } = u({
|
|
243
|
+
channelId: e.id,
|
|
244
|
+
status: "PUBLISHED",
|
|
245
|
+
pagination: {
|
|
246
|
+
limit: me,
|
|
247
|
+
cursor: n.cursor
|
|
248
|
+
}
|
|
249
|
+
}), s = r?.items ?? [], c = t && e.type !== "ANNOUNCEMENT" && e.type !== "VOICE";
|
|
250
|
+
return /* @__PURE__ */ I("div", {
|
|
251
|
+
className: "flex flex-col gap-4",
|
|
252
|
+
children: [
|
|
253
|
+
/* @__PURE__ */ I("div", {
|
|
254
|
+
className: "flex items-center gap-2",
|
|
255
|
+
children: [(() => {
|
|
256
|
+
let t = Z[e.type];
|
|
257
|
+
return /* @__PURE__ */ F(t, { className: "h-5 w-5 text-text-tertiary" });
|
|
258
|
+
})(), /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("h2", {
|
|
259
|
+
className: "text-lg font-semibold text-text-primary",
|
|
260
|
+
children: e.name
|
|
261
|
+
}), e.description && /* @__PURE__ */ F("p", {
|
|
262
|
+
className: "text-sm text-text-secondary",
|
|
263
|
+
children: e.description
|
|
264
|
+
})] })]
|
|
265
|
+
}),
|
|
266
|
+
c && /* @__PURE__ */ F(D, {
|
|
267
|
+
channelId: e.id,
|
|
268
|
+
channelName: e.name,
|
|
269
|
+
onPosted: () => n.reset()
|
|
270
|
+
}),
|
|
271
|
+
e.type === "VOICE" && /* @__PURE__ */ I("div", {
|
|
272
|
+
className: "rounded-xl border border-dashed border-border-seam p-6 text-center text-sm text-text-secondary",
|
|
273
|
+
children: [/* @__PURE__ */ F(le, { className: "mx-auto mb-2 h-6 w-6 text-text-tertiary" }), "Voice channels are for live audio. Text posting is disabled here."]
|
|
274
|
+
}),
|
|
275
|
+
i ? /* @__PURE__ */ F(C, { label: "Loading posts…" }) : a ? /* @__PURE__ */ F(S, {
|
|
276
|
+
message: "We couldn't load posts.",
|
|
277
|
+
onRetry: () => o()
|
|
278
|
+
}) : s.length === 0 ? /* @__PURE__ */ F(x, {
|
|
279
|
+
icon: /* @__PURE__ */ F(se, { className: "h-9 w-9" }),
|
|
280
|
+
title: "No posts yet",
|
|
281
|
+
description: c ? "Be the first to post in this channel." : "Nothing has been posted here yet."
|
|
282
|
+
}) : /* @__PURE__ */ I("div", {
|
|
283
|
+
className: "flex flex-col gap-4",
|
|
284
|
+
children: [s.map((e) => /* @__PURE__ */ F(b, { post: e }, e.id)), /* @__PURE__ */ F(w, {
|
|
285
|
+
page: n.page,
|
|
286
|
+
pageSize: me,
|
|
287
|
+
itemCount: s.length,
|
|
288
|
+
hasMore: r?.pageInfo.hasMore ?? !1,
|
|
289
|
+
onPageChange: (e) => n.onPageChange(e, r?.pageInfo.cursor)
|
|
290
|
+
})]
|
|
291
|
+
})
|
|
292
|
+
]
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
function ve({ circle: e, canManage: t }) {
|
|
296
|
+
let n = d(), r = O(() => [...e.memberships ?? []].sort((e, t) => Q.indexOf(e.role) - Q.indexOf(t.role)), [e.memberships]);
|
|
297
|
+
if (r.length === 0) return /* @__PURE__ */ F(x, {
|
|
298
|
+
icon: /* @__PURE__ */ F(P, { className: "h-9 w-9" }),
|
|
299
|
+
title: "No members yet"
|
|
300
|
+
});
|
|
301
|
+
let i = async (t, r) => {
|
|
302
|
+
try {
|
|
303
|
+
await n.mutateAsync({
|
|
304
|
+
membershipId: t,
|
|
305
|
+
role: r,
|
|
306
|
+
circleId: e.id
|
|
307
|
+
}), g.success("Role updated");
|
|
308
|
+
} catch (e) {
|
|
309
|
+
g.error("Could not update role", h(e));
|
|
310
|
+
}
|
|
311
|
+
};
|
|
312
|
+
return /* @__PURE__ */ F("div", {
|
|
313
|
+
className: "flex flex-col gap-2",
|
|
314
|
+
children: r.map((e) => /* @__PURE__ */ I("div", {
|
|
315
|
+
className: "flex items-center justify-between gap-3 rounded-xl border border-border-seam bg-bg-surface px-4 py-2.5",
|
|
316
|
+
children: [/* @__PURE__ */ F(m, {
|
|
317
|
+
memberId: e.memberId,
|
|
318
|
+
variant: "row",
|
|
319
|
+
size: "md",
|
|
320
|
+
showPresence: !0
|
|
321
|
+
}), /* @__PURE__ */ I("div", {
|
|
322
|
+
className: "flex items-center gap-2",
|
|
323
|
+
children: [/* @__PURE__ */ F(E, { status: e.status }), t ? /* @__PURE__ */ I(K, {
|
|
324
|
+
value: e.role,
|
|
325
|
+
onValueChange: (t) => i(e.id, t),
|
|
326
|
+
children: [/* @__PURE__ */ F(Y, {
|
|
327
|
+
className: "h-8 w-32",
|
|
328
|
+
children: /* @__PURE__ */ F(X, {})
|
|
329
|
+
}), /* @__PURE__ */ F(q, { children: Q.map((e) => /* @__PURE__ */ F(J, {
|
|
330
|
+
value: e,
|
|
331
|
+
children: v(e)
|
|
332
|
+
}, e)) })]
|
|
333
|
+
}) : /* @__PURE__ */ F(E, { status: e.role })]
|
|
334
|
+
})]
|
|
335
|
+
}, e.id))
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
function ye({ circle: t, isMember: n }) {
|
|
339
|
+
let { navigateTo: r } = e(), { data: i, isLoading: a, isError: s, refetch: c } = o({ circleId: t.id }), [l, u] = k(!1), d = i?.items ?? [];
|
|
340
|
+
return /* @__PURE__ */ I("div", { children: [
|
|
341
|
+
/* @__PURE__ */ F("div", {
|
|
342
|
+
className: "mb-4 flex items-center justify-end",
|
|
343
|
+
children: n && /* @__PURE__ */ I(L, {
|
|
344
|
+
onClick: () => u(!0),
|
|
345
|
+
children: [/* @__PURE__ */ F(N, { className: "mr-1.5 h-4 w-4" }), " New event"]
|
|
346
|
+
})
|
|
347
|
+
}),
|
|
348
|
+
a ? /* @__PURE__ */ F(C, { label: "Loading events…" }) : s ? /* @__PURE__ */ F(S, { onRetry: () => c() }) : d.length === 0 ? /* @__PURE__ */ F(x, {
|
|
349
|
+
icon: /* @__PURE__ */ F(j, { className: "h-9 w-9" }),
|
|
350
|
+
title: "No events scheduled",
|
|
351
|
+
description: n ? "Schedule the first event for this circle." : "No upcoming events.",
|
|
352
|
+
action: n ? /* @__PURE__ */ I(L, {
|
|
353
|
+
onClick: () => u(!0),
|
|
354
|
+
children: [/* @__PURE__ */ F(N, { className: "mr-1.5 h-4 w-4" }), " New event"]
|
|
355
|
+
}) : void 0
|
|
356
|
+
}) : /* @__PURE__ */ F("div", {
|
|
357
|
+
className: "grid gap-4 md:grid-cols-2",
|
|
358
|
+
children: d.map((e) => /* @__PURE__ */ F(te, {
|
|
359
|
+
event: e,
|
|
360
|
+
onOpen: () => r(`events/${e.id}`)
|
|
361
|
+
}, e.id))
|
|
362
|
+
}),
|
|
363
|
+
/* @__PURE__ */ F(re, {
|
|
364
|
+
circleId: t.id,
|
|
365
|
+
open: l,
|
|
366
|
+
onOpenChange: u
|
|
367
|
+
})
|
|
368
|
+
] });
|
|
369
|
+
}
|
|
370
|
+
function be({ circle: e, isMember: t, canManage: n }) {
|
|
371
|
+
let { data: r, isLoading: i, isError: a, refetch: o } = l(e.id), [s, c] = k(!1);
|
|
372
|
+
return /* @__PURE__ */ I("div", { children: [
|
|
373
|
+
/* @__PURE__ */ F("div", {
|
|
374
|
+
className: "mb-4 flex items-center justify-end",
|
|
375
|
+
children: t && /* @__PURE__ */ I(L, {
|
|
376
|
+
onClick: () => c(!0),
|
|
377
|
+
children: [/* @__PURE__ */ F(N, { className: "mr-1.5 h-4 w-4" }), " New poll"]
|
|
378
|
+
})
|
|
379
|
+
}),
|
|
380
|
+
i ? /* @__PURE__ */ F(C, { label: "Loading polls…" }) : a ? /* @__PURE__ */ F(S, { onRetry: () => o() }) : (r ?? []).length === 0 ? /* @__PURE__ */ F(x, {
|
|
381
|
+
icon: /* @__PURE__ */ F(A, { className: "h-9 w-9" }),
|
|
382
|
+
title: "No polls yet",
|
|
383
|
+
description: t ? "Ask the circle a question with a poll." : "No polls have been created.",
|
|
384
|
+
action: t ? /* @__PURE__ */ I(L, {
|
|
385
|
+
onClick: () => c(!0),
|
|
386
|
+
children: [/* @__PURE__ */ F(N, { className: "mr-1.5 h-4 w-4" }), " New poll"]
|
|
387
|
+
}) : void 0
|
|
388
|
+
}) : /* @__PURE__ */ F("div", {
|
|
389
|
+
className: "mx-auto flex max-w-2xl flex-col gap-4",
|
|
390
|
+
children: (r ?? []).map((e) => /* @__PURE__ */ F(ne, {
|
|
391
|
+
poll: e,
|
|
392
|
+
canManage: n
|
|
393
|
+
}, e.id))
|
|
394
|
+
}),
|
|
395
|
+
/* @__PURE__ */ F(Ce, {
|
|
396
|
+
circleId: e.id,
|
|
397
|
+
open: s,
|
|
398
|
+
onOpenChange: c
|
|
399
|
+
})
|
|
400
|
+
] });
|
|
401
|
+
}
|
|
402
|
+
function xe({ circle: e }) {
|
|
403
|
+
return /* @__PURE__ */ F("div", {
|
|
404
|
+
className: "mx-auto max-w-2xl",
|
|
405
|
+
children: /* @__PURE__ */ I("div", {
|
|
406
|
+
className: "rounded-2xl border border-border-seam bg-bg-surface p-6",
|
|
407
|
+
children: [
|
|
408
|
+
/* @__PURE__ */ F("h2", {
|
|
409
|
+
className: "text-lg font-semibold text-text-primary",
|
|
410
|
+
children: "About this circle"
|
|
411
|
+
}),
|
|
412
|
+
/* @__PURE__ */ F("p", {
|
|
413
|
+
className: "mt-2 whitespace-pre-wrap text-sm text-text-secondary",
|
|
414
|
+
children: e.description || "No description provided."
|
|
415
|
+
}),
|
|
416
|
+
e.tags.length > 0 && /* @__PURE__ */ F("div", {
|
|
417
|
+
className: "mt-4 flex flex-wrap gap-1.5",
|
|
418
|
+
children: e.tags.map((e) => /* @__PURE__ */ I("span", {
|
|
419
|
+
className: "rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs font-medium text-text-secondary",
|
|
420
|
+
children: ["#", e]
|
|
421
|
+
}, e))
|
|
422
|
+
}),
|
|
423
|
+
/* @__PURE__ */ I("dl", {
|
|
424
|
+
className: "mt-6 grid grid-cols-2 gap-4 text-sm",
|
|
425
|
+
children: [
|
|
426
|
+
/* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("dt", {
|
|
427
|
+
className: "text-text-tertiary",
|
|
428
|
+
children: "Visibility"
|
|
429
|
+
}), /* @__PURE__ */ F("dd", {
|
|
430
|
+
className: "mt-1 text-text-primary",
|
|
431
|
+
children: v(e.visibility)
|
|
432
|
+
})] }),
|
|
433
|
+
/* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("dt", {
|
|
434
|
+
className: "text-text-tertiary",
|
|
435
|
+
children: "Status"
|
|
436
|
+
}), /* @__PURE__ */ F("dd", {
|
|
437
|
+
className: "mt-1 text-text-primary",
|
|
438
|
+
children: v(e.status)
|
|
439
|
+
})] }),
|
|
440
|
+
/* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("dt", {
|
|
441
|
+
className: "text-text-tertiary",
|
|
442
|
+
children: "Members"
|
|
443
|
+
}), /* @__PURE__ */ F("dd", {
|
|
444
|
+
className: "mt-1 text-text-primary",
|
|
445
|
+
children: y(e.memberCount)
|
|
446
|
+
})] }),
|
|
447
|
+
/* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("dt", {
|
|
448
|
+
className: "text-text-tertiary",
|
|
449
|
+
children: "Created"
|
|
450
|
+
}), /* @__PURE__ */ F("dd", {
|
|
451
|
+
className: "mt-1 text-text-primary",
|
|
452
|
+
children: _(e.createdAt)
|
|
453
|
+
})] })
|
|
454
|
+
]
|
|
455
|
+
})
|
|
456
|
+
]
|
|
457
|
+
})
|
|
458
|
+
});
|
|
459
|
+
}
|
|
460
|
+
var Se = [
|
|
461
|
+
"TEXT",
|
|
462
|
+
"FORUM",
|
|
463
|
+
"ANNOUNCEMENT",
|
|
464
|
+
"VOICE"
|
|
465
|
+
];
|
|
466
|
+
function $({ circleId: e, open: t, onOpenChange: n, onCreated: r }) {
|
|
467
|
+
let a = i(), [o, s] = k(""), [c, l] = k(""), [u, d] = k("TEXT"), [f, p] = k(null);
|
|
468
|
+
return /* @__PURE__ */ F(B, {
|
|
469
|
+
open: t,
|
|
470
|
+
onOpenChange: n,
|
|
471
|
+
children: /* @__PURE__ */ I(V, {
|
|
472
|
+
className: "sm:max-w-md",
|
|
473
|
+
children: [
|
|
474
|
+
/* @__PURE__ */ I(W, { children: [/* @__PURE__ */ F(G, { children: "Create a channel" }), /* @__PURE__ */ F(H, { children: "Channels organise conversations by topic or format." })] }),
|
|
475
|
+
/* @__PURE__ */ I("div", {
|
|
476
|
+
className: "flex flex-col gap-4 py-2",
|
|
477
|
+
children: [
|
|
478
|
+
/* @__PURE__ */ I("div", {
|
|
479
|
+
className: "grid gap-1.5",
|
|
480
|
+
children: [/* @__PURE__ */ F(z, {
|
|
481
|
+
htmlFor: "channel-name",
|
|
482
|
+
children: "Name"
|
|
483
|
+
}), /* @__PURE__ */ F(R, {
|
|
484
|
+
id: "channel-name",
|
|
485
|
+
value: o,
|
|
486
|
+
onChange: (e) => s(e.target.value),
|
|
487
|
+
placeholder: "general"
|
|
488
|
+
})]
|
|
489
|
+
}),
|
|
490
|
+
/* @__PURE__ */ I("div", {
|
|
491
|
+
className: "grid gap-1.5",
|
|
492
|
+
children: [/* @__PURE__ */ F(z, { children: "Type" }), /* @__PURE__ */ I(K, {
|
|
493
|
+
value: u,
|
|
494
|
+
onValueChange: (e) => d(e),
|
|
495
|
+
children: [/* @__PURE__ */ F(Y, { children: /* @__PURE__ */ F(X, {}) }), /* @__PURE__ */ F(q, { children: Se.map((e) => /* @__PURE__ */ F(J, {
|
|
496
|
+
value: e,
|
|
497
|
+
children: v(e)
|
|
498
|
+
}, e)) })]
|
|
499
|
+
})]
|
|
500
|
+
}),
|
|
501
|
+
/* @__PURE__ */ I("div", {
|
|
502
|
+
className: "grid gap-1.5",
|
|
503
|
+
children: [/* @__PURE__ */ F(z, {
|
|
504
|
+
htmlFor: "channel-desc",
|
|
505
|
+
children: "Description"
|
|
506
|
+
}), /* @__PURE__ */ F(fe, {
|
|
507
|
+
id: "channel-desc",
|
|
508
|
+
value: c,
|
|
509
|
+
onChange: (e) => l(e.target.value),
|
|
510
|
+
rows: 2
|
|
511
|
+
})]
|
|
512
|
+
}),
|
|
513
|
+
f && /* @__PURE__ */ F("p", {
|
|
514
|
+
className: "text-sm text-status-error-text",
|
|
515
|
+
children: f
|
|
516
|
+
})
|
|
517
|
+
]
|
|
518
|
+
}),
|
|
519
|
+
/* @__PURE__ */ I(U, { children: [/* @__PURE__ */ F(L, {
|
|
520
|
+
variant: "outline",
|
|
521
|
+
onClick: () => n(!1),
|
|
522
|
+
children: "Cancel"
|
|
523
|
+
}), /* @__PURE__ */ F(L, {
|
|
524
|
+
onClick: async () => {
|
|
525
|
+
if (!o.trim()) {
|
|
526
|
+
p("Channel name is required.");
|
|
527
|
+
return;
|
|
528
|
+
}
|
|
529
|
+
try {
|
|
530
|
+
let t = await a.mutateAsync({
|
|
531
|
+
circleId: e,
|
|
532
|
+
name: o.trim(),
|
|
533
|
+
slug: T(o),
|
|
534
|
+
description: c.trim() || null,
|
|
535
|
+
type: u
|
|
536
|
+
});
|
|
537
|
+
g.success("Channel created", `#${t.name}`), n(!1), s(""), l(""), d("TEXT"), p(null), r?.(t);
|
|
538
|
+
} catch (e) {
|
|
539
|
+
p(h(e));
|
|
540
|
+
}
|
|
541
|
+
},
|
|
542
|
+
disabled: a.isPending,
|
|
543
|
+
children: "Create channel"
|
|
544
|
+
})] })
|
|
545
|
+
]
|
|
546
|
+
})
|
|
547
|
+
});
|
|
548
|
+
}
|
|
549
|
+
function Ce({ circleId: e, open: t, onOpenChange: n }) {
|
|
550
|
+
let r = a(), [i, o] = k(""), [s, c] = k(["", ""]), [l, u] = k(!1), [d, f] = k(null), p = () => {
|
|
551
|
+
o(""), c(["", ""]), u(!1), f(null);
|
|
552
|
+
};
|
|
553
|
+
return /* @__PURE__ */ F(B, {
|
|
554
|
+
open: t,
|
|
555
|
+
onOpenChange: n,
|
|
556
|
+
children: /* @__PURE__ */ I(V, {
|
|
557
|
+
className: "sm:max-w-md",
|
|
558
|
+
children: [
|
|
559
|
+
/* @__PURE__ */ I(W, { children: [/* @__PURE__ */ F(G, { children: "Create a poll" }), /* @__PURE__ */ F(H, { children: "Gather the circle's opinion." })] }),
|
|
560
|
+
/* @__PURE__ */ I("div", {
|
|
561
|
+
className: "flex flex-col gap-4 py-2",
|
|
562
|
+
children: [
|
|
563
|
+
/* @__PURE__ */ I("div", {
|
|
564
|
+
className: "grid gap-1.5",
|
|
565
|
+
children: [/* @__PURE__ */ F(z, {
|
|
566
|
+
htmlFor: "poll-q",
|
|
567
|
+
children: "Question"
|
|
568
|
+
}), /* @__PURE__ */ F(R, {
|
|
569
|
+
id: "poll-q",
|
|
570
|
+
value: i,
|
|
571
|
+
onChange: (e) => o(e.target.value),
|
|
572
|
+
placeholder: "What should we build next?"
|
|
573
|
+
})]
|
|
574
|
+
}),
|
|
575
|
+
/* @__PURE__ */ I("div", {
|
|
576
|
+
className: "grid gap-1.5",
|
|
577
|
+
children: [/* @__PURE__ */ F(z, { children: "Options" }), /* @__PURE__ */ I("div", {
|
|
578
|
+
className: "flex flex-col gap-2",
|
|
579
|
+
children: [s.map((e, t) => /* @__PURE__ */ I("div", {
|
|
580
|
+
className: "flex items-center gap-2",
|
|
581
|
+
children: [/* @__PURE__ */ F(R, {
|
|
582
|
+
value: e,
|
|
583
|
+
onChange: (e) => c((n) => n.map((n, r) => r === t ? e.target.value : n)),
|
|
584
|
+
placeholder: `Option ${t + 1}`
|
|
585
|
+
}), s.length > 2 && /* @__PURE__ */ F(L, {
|
|
586
|
+
variant: "ghost",
|
|
587
|
+
size: "icon",
|
|
588
|
+
onClick: () => c((e) => e.filter((e, n) => n !== t)),
|
|
589
|
+
"aria-label": `Remove option ${t + 1}`,
|
|
590
|
+
children: "✕"
|
|
591
|
+
})]
|
|
592
|
+
}, t)), s.length < 8 && /* @__PURE__ */ I(L, {
|
|
593
|
+
variant: "outline",
|
|
594
|
+
size: "sm",
|
|
595
|
+
onClick: () => c((e) => [...e, ""]),
|
|
596
|
+
children: [/* @__PURE__ */ F(N, { className: "mr-1.5 h-4 w-4" }), " Add option"]
|
|
597
|
+
})]
|
|
598
|
+
})]
|
|
599
|
+
}),
|
|
600
|
+
/* @__PURE__ */ I("label", {
|
|
601
|
+
className: "flex items-center gap-2 text-sm text-text-secondary",
|
|
602
|
+
children: [/* @__PURE__ */ F("input", {
|
|
603
|
+
type: "checkbox",
|
|
604
|
+
checked: l,
|
|
605
|
+
onChange: (e) => u(e.target.checked),
|
|
606
|
+
className: "h-4 w-4 rounded border-border-seam"
|
|
607
|
+
}), "Allow selecting multiple options"]
|
|
608
|
+
}),
|
|
609
|
+
d && /* @__PURE__ */ F("p", {
|
|
610
|
+
className: "text-sm text-status-error-text",
|
|
611
|
+
children: d
|
|
612
|
+
})
|
|
613
|
+
]
|
|
614
|
+
}),
|
|
615
|
+
/* @__PURE__ */ I(U, { children: [/* @__PURE__ */ F(L, {
|
|
616
|
+
variant: "outline",
|
|
617
|
+
onClick: () => n(!1),
|
|
618
|
+
children: "Cancel"
|
|
619
|
+
}), /* @__PURE__ */ F(L, {
|
|
620
|
+
onClick: async () => {
|
|
621
|
+
let t = s.map((e) => e.trim()).filter(Boolean);
|
|
622
|
+
if (!i.trim()) {
|
|
623
|
+
f("A question is required.");
|
|
624
|
+
return;
|
|
625
|
+
}
|
|
626
|
+
if (t.length < 2) {
|
|
627
|
+
f("Add at least two options.");
|
|
628
|
+
return;
|
|
629
|
+
}
|
|
630
|
+
try {
|
|
631
|
+
await r.mutateAsync({
|
|
632
|
+
circleId: e,
|
|
633
|
+
question: i.trim(),
|
|
634
|
+
options: t,
|
|
635
|
+
allowMultiple: l
|
|
636
|
+
}), g.success("Poll created"), n(!1), p();
|
|
637
|
+
} catch (e) {
|
|
638
|
+
f(h(e));
|
|
639
|
+
}
|
|
640
|
+
},
|
|
641
|
+
disabled: r.isPending,
|
|
642
|
+
children: "Create poll"
|
|
643
|
+
})] })
|
|
644
|
+
]
|
|
645
|
+
})
|
|
646
|
+
});
|
|
647
|
+
}
|
|
648
|
+
//#endregion
|
|
649
|
+
export { he as CircleDetailPage };
|
|
650
|
+
|
|
651
|
+
//# sourceMappingURL=CircleDetailPage.js.map
|