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