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