@burdenoff/microfe-comradecircle 2026.704.1 → 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 +52 -17
- package/dist/comradecircle/components/Avatar.js.map +1 -1
- package/dist/comradecircle/components/AvatarUploadField.js +91 -0
- package/dist/comradecircle/components/AvatarUploadField.js.map +1 -0
- package/dist/comradecircle/components/CircleCard.js +55 -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/CreateCircleDialog.js +74 -63
- package/dist/comradecircle/components/CreateCircleDialog.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/FileImage.js +20 -0
- package/dist/comradecircle/components/FileImage.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 +4 -2
- 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 +8 -15
- package/dist/comradecircle/components/PostCard.js.map +1 -1
- package/dist/comradecircle/components/PostComposer.js +45 -35
- package/dist/comradecircle/components/PostComposer.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/index.js +1 -0
- package/dist/comradecircle/hooks/useComradeCircleApi.js +244 -241
- package/dist/comradecircle/hooks/useComradeCircleApi.js.map +1 -1
- package/dist/comradecircle/hooks/useFiles.js +78 -0
- package/dist/comradecircle/hooks/useFiles.js.map +1 -0
- package/dist/comradecircle/lib/graphql-cache.js +9 -0
- package/dist/comradecircle/lib/graphql-cache.js.map +1 -0
- 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 -242
- 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 -81
- package/dist/comradecircle/pages/members/MemberProfilePage.js.map +1 -1
- package/dist/comradecircle/pages/members/MembersPage.js +141 -71
- package/dist/comradecircle/pages/members/MembersPage.js.map +1 -1
- package/dist/comradecircle/pages/profile/MyProfilePage.js +298 -191
- package/dist/comradecircle/pages/profile/MyProfilePage.js.map +1 -1
- package/package.json +1 -1
|
@@ -13,111 +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
|
-
|
|
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
|
+
})]
|
|
90
97
|
}),
|
|
91
98
|
description: o.topic ?? void 0,
|
|
92
|
-
|
|
99
|
+
aurora: !0,
|
|
100
|
+
actions: /* @__PURE__ */ L("div", {
|
|
93
101
|
className: "flex items-center gap-2",
|
|
94
|
-
children: [/* @__PURE__ */
|
|
102
|
+
children: [/* @__PURE__ */ L(R, {
|
|
95
103
|
variant: "ghost",
|
|
96
104
|
size: "sm",
|
|
97
105
|
onClick: () => a("circles"),
|
|
98
|
-
children: [/* @__PURE__ */
|
|
99
|
-
}), x ? /* @__PURE__ */
|
|
106
|
+
children: [/* @__PURE__ */ I(ae, { className: "mr-1.5 h-4 w-4" }), " Back"]
|
|
107
|
+
}), x ? /* @__PURE__ */ I(R, {
|
|
100
108
|
variant: "outline",
|
|
101
109
|
onClick: () => m.mutateAsync(o.id).then(() => g.success("Left circle")).catch((e) => g.error("Could not leave", h(e))),
|
|
102
110
|
disabled: m.isPending,
|
|
103
111
|
children: "Leave"
|
|
104
|
-
}) : o.status === "ACTIVE" ? /* @__PURE__ */
|
|
112
|
+
}) : o.status === "ACTIVE" ? /* @__PURE__ */ I(R, {
|
|
105
113
|
onClick: () => f.mutateAsync(o.id).then(() => g.success("Joined circle")).catch((e) => g.error("Could not join", h(e))),
|
|
106
114
|
disabled: f.isPending,
|
|
107
115
|
children: "Join circle"
|
|
108
116
|
}) : null]
|
|
109
117
|
}),
|
|
110
118
|
children: [
|
|
111
|
-
/* @__PURE__ */
|
|
119
|
+
/* @__PURE__ */ L("div", {
|
|
112
120
|
className: "mb-4 flex flex-wrap items-center gap-2",
|
|
113
121
|
children: [
|
|
114
|
-
/* @__PURE__ */
|
|
115
|
-
o.status !== "ACTIVE" && /* @__PURE__ */
|
|
116
|
-
b && /* @__PURE__ */
|
|
117
|
-
/* @__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", {
|
|
118
126
|
className: "inline-flex items-center gap-1 text-sm text-text-tertiary",
|
|
119
127
|
children: [
|
|
120
|
-
/* @__PURE__ */ F
|
|
128
|
+
/* @__PURE__ */ I(F, { className: "h-4 w-4" }),
|
|
121
129
|
" ",
|
|
122
130
|
y(o.memberCount),
|
|
123
131
|
" members"
|
|
@@ -125,75 +133,76 @@ function he() {
|
|
|
125
133
|
})
|
|
126
134
|
]
|
|
127
135
|
}),
|
|
128
|
-
/* @__PURE__ */
|
|
129
|
-
items:
|
|
136
|
+
/* @__PURE__ */ I(te, {
|
|
137
|
+
items: E,
|
|
130
138
|
value: _,
|
|
131
139
|
onChange: v,
|
|
132
140
|
className: "mb-5"
|
|
133
141
|
}),
|
|
134
|
-
_ === "channels" && /* @__PURE__ */
|
|
142
|
+
_ === "channels" && /* @__PURE__ */ I(ve, {
|
|
135
143
|
circle: o,
|
|
136
144
|
isMember: x,
|
|
137
145
|
canManage: w
|
|
138
146
|
}),
|
|
139
|
-
_ === "members" && /* @__PURE__ */
|
|
147
|
+
_ === "members" && /* @__PURE__ */ I(be, {
|
|
140
148
|
circle: o,
|
|
141
149
|
canManage: w
|
|
142
150
|
}),
|
|
143
|
-
_ === "events" && /* @__PURE__ */
|
|
151
|
+
_ === "events" && /* @__PURE__ */ I(xe, {
|
|
144
152
|
circle: o,
|
|
145
153
|
isMember: x
|
|
146
154
|
}),
|
|
147
|
-
_ === "polls" && /* @__PURE__ */
|
|
155
|
+
_ === "polls" && /* @__PURE__ */ I(Se, {
|
|
148
156
|
circle: o,
|
|
149
157
|
isMember: x,
|
|
150
158
|
canManage: w
|
|
151
159
|
}),
|
|
152
|
-
_ === "about" && /* @__PURE__ */
|
|
160
|
+
_ === "about" && /* @__PURE__ */ I(Ce, { circle: o })
|
|
153
161
|
]
|
|
154
162
|
});
|
|
155
163
|
}
|
|
156
|
-
function
|
|
157
|
-
let i =
|
|
158
|
-
return i.length === 0 ? /* @__PURE__ */
|
|
159
|
-
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" }),
|
|
160
168
|
title: "No channels yet",
|
|
161
169
|
description: r ? "Create the first channel to start conversations in this circle." : "This circle has no channels yet. Check back soon.",
|
|
162
|
-
action: r ? /* @__PURE__ */
|
|
170
|
+
action: r ? /* @__PURE__ */ L(R, {
|
|
163
171
|
onClick: () => c(!0),
|
|
164
|
-
children: [/* @__PURE__ */
|
|
172
|
+
children: [/* @__PURE__ */ I(P, { className: "mr-1.5 h-4 w-4" }), " New channel"]
|
|
165
173
|
}) : void 0
|
|
166
|
-
}), /* @__PURE__ */
|
|
174
|
+
}), /* @__PURE__ */ I(Te, {
|
|
167
175
|
circleId: e.id,
|
|
168
176
|
open: s,
|
|
169
177
|
onOpenChange: c,
|
|
170
178
|
onCreated: (e) => o(e.id)
|
|
171
|
-
})] }) : /* @__PURE__ */
|
|
179
|
+
})] }) : /* @__PURE__ */ L("div", {
|
|
172
180
|
className: "grid gap-5 lg:grid-cols-[220px_1fr]",
|
|
173
181
|
children: [
|
|
174
|
-
/* @__PURE__ */
|
|
182
|
+
/* @__PURE__ */ L("aside", {
|
|
175
183
|
className: "hidden lg:block",
|
|
176
|
-
children: [/* @__PURE__ */
|
|
184
|
+
children: [/* @__PURE__ */ L("div", {
|
|
177
185
|
className: "mb-2 flex items-center justify-between",
|
|
178
|
-
children: [/* @__PURE__ */
|
|
186
|
+
children: [/* @__PURE__ */ I("h3", {
|
|
179
187
|
className: "text-xs font-semibold uppercase tracking-wide text-text-tertiary",
|
|
180
188
|
children: "Channels"
|
|
181
|
-
}), r && /* @__PURE__ */
|
|
189
|
+
}), r && /* @__PURE__ */ I("button", {
|
|
182
190
|
type: "button",
|
|
183
191
|
onClick: () => c(!0),
|
|
184
192
|
"aria-label": "New channel",
|
|
185
193
|
className: "rounded-md p-1 text-text-tertiary hover:bg-bg-sunken hover:text-text-primary",
|
|
186
|
-
children: /* @__PURE__ */
|
|
194
|
+
children: /* @__PURE__ */ I(P, { className: "h-4 w-4" })
|
|
187
195
|
})]
|
|
188
|
-
}), /* @__PURE__ */
|
|
196
|
+
}), /* @__PURE__ */ I("nav", {
|
|
189
197
|
className: "flex flex-col gap-0.5",
|
|
190
198
|
children: i.map((e) => {
|
|
191
|
-
let n =
|
|
192
|
-
return /* @__PURE__ */
|
|
199
|
+
let n = me[e.type], r = e.id === l?.id;
|
|
200
|
+
return /* @__PURE__ */ L("button", {
|
|
193
201
|
type: "button",
|
|
194
202
|
onClick: () => o(e.id),
|
|
195
|
-
|
|
196
|
-
|
|
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", {
|
|
197
206
|
className: "truncate",
|
|
198
207
|
children: e.name
|
|
199
208
|
})]
|
|
@@ -201,34 +210,35 @@ function ge({ circle: e, isMember: n, canManage: r }) {
|
|
|
201
210
|
})
|
|
202
211
|
})]
|
|
203
212
|
}),
|
|
204
|
-
/* @__PURE__ */
|
|
213
|
+
/* @__PURE__ */ I("div", {
|
|
205
214
|
className: "lg:hidden",
|
|
206
|
-
children: /* @__PURE__ */
|
|
215
|
+
children: /* @__PURE__ */ L("div", {
|
|
207
216
|
className: "flex items-center gap-2",
|
|
208
|
-
children: [/* @__PURE__ */
|
|
217
|
+
children: [/* @__PURE__ */ L(q, {
|
|
209
218
|
value: l?.id,
|
|
210
219
|
onValueChange: o,
|
|
211
|
-
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, {
|
|
212
221
|
value: e.id,
|
|
213
222
|
children: ["#", e.name]
|
|
214
223
|
}, e.id)) })]
|
|
215
|
-
}), r && /* @__PURE__ */
|
|
224
|
+
}), r && /* @__PURE__ */ I(R, {
|
|
216
225
|
variant: "outline",
|
|
217
226
|
size: "icon",
|
|
218
227
|
onClick: () => c(!0),
|
|
219
228
|
"aria-label": "New channel",
|
|
220
|
-
children: /* @__PURE__ */
|
|
229
|
+
children: /* @__PURE__ */ I(P, { className: "h-4 w-4" })
|
|
221
230
|
})]
|
|
222
231
|
})
|
|
223
232
|
}),
|
|
224
|
-
/* @__PURE__ */
|
|
233
|
+
/* @__PURE__ */ I("div", {
|
|
225
234
|
className: "min-w-0",
|
|
226
|
-
children: l && /* @__PURE__ */
|
|
235
|
+
children: l && /* @__PURE__ */ I(ye, {
|
|
227
236
|
channel: l,
|
|
228
|
-
canPost: n
|
|
237
|
+
canPost: n,
|
|
238
|
+
canManage: r
|
|
229
239
|
})
|
|
230
240
|
}),
|
|
231
|
-
/* @__PURE__ */
|
|
241
|
+
/* @__PURE__ */ I(Te, {
|
|
232
242
|
circleId: e.id,
|
|
233
243
|
open: s,
|
|
234
244
|
onOpenChange: c,
|
|
@@ -237,216 +247,266 @@ function ge({ circle: e, isMember: n, canManage: r }) {
|
|
|
237
247
|
]
|
|
238
248
|
});
|
|
239
249
|
}
|
|
240
|
-
function
|
|
241
|
-
let
|
|
250
|
+
function ye({ channel: e, canPost: t, canManage: n }) {
|
|
251
|
+
let r = f(), { data: i, isLoading: a, isError: o, refetch: s } = u({
|
|
242
252
|
channelId: e.id,
|
|
243
253
|
status: "PUBLISHED",
|
|
244
254
|
pagination: {
|
|
245
|
-
limit:
|
|
246
|
-
cursor:
|
|
255
|
+
limit: ge,
|
|
256
|
+
cursor: r.cursor
|
|
247
257
|
}
|
|
248
|
-
}),
|
|
249
|
-
return /* @__PURE__ */
|
|
258
|
+
}), c = i?.items ?? [], l = e.type === "VOICE" ? !1 : e.type === "ANNOUNCEMENT" ? n : t;
|
|
259
|
+
return /* @__PURE__ */ L("div", {
|
|
250
260
|
className: "flex flex-col gap-4",
|
|
251
261
|
children: [
|
|
252
|
-
/* @__PURE__ */
|
|
253
|
-
className: "flex items-center gap-
|
|
262
|
+
/* @__PURE__ */ L("div", {
|
|
263
|
+
className: "flex items-center gap-3",
|
|
254
264
|
children: [(() => {
|
|
255
|
-
let t =
|
|
256
|
-
return /* @__PURE__ */
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
}),
|
|
261
|
-
className: "
|
|
262
|
-
children:
|
|
263
|
-
|
|
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
|
+
})]
|
|
264
280
|
}),
|
|
265
|
-
|
|
281
|
+
l && /* @__PURE__ */ I(E, {
|
|
266
282
|
channelId: e.id,
|
|
267
283
|
channelName: e.name,
|
|
268
|
-
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."]
|
|
269
289
|
}),
|
|
270
|
-
e.type === "VOICE" && /* @__PURE__ */
|
|
290
|
+
e.type === "VOICE" && /* @__PURE__ */ L("div", {
|
|
271
291
|
className: "rounded-xl border border-dashed border-border-seam p-6 text-center text-sm text-text-secondary",
|
|
272
|
-
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."]
|
|
273
293
|
}),
|
|
274
|
-
|
|
294
|
+
a ? /* @__PURE__ */ I(C, { label: "Loading posts…" }) : o ? /* @__PURE__ */ I(S, {
|
|
275
295
|
message: "We couldn't load posts.",
|
|
276
|
-
onRetry: () =>
|
|
277
|
-
}) :
|
|
278
|
-
icon: /* @__PURE__ */
|
|
296
|
+
onRetry: () => s()
|
|
297
|
+
}) : c.length === 0 ? /* @__PURE__ */ I(x, {
|
|
298
|
+
icon: /* @__PURE__ */ I(se, { className: "h-9 w-9" }),
|
|
279
299
|
title: "No posts yet",
|
|
280
|
-
description:
|
|
281
|
-
}) : /* @__PURE__ */
|
|
300
|
+
description: l ? "Be the first to post in this channel." : "Nothing has been posted here yet."
|
|
301
|
+
}) : /* @__PURE__ */ L("div", {
|
|
282
302
|
className: "flex flex-col gap-4",
|
|
283
|
-
children: [
|
|
284
|
-
page:
|
|
285
|
-
pageSize:
|
|
286
|
-
itemCount:
|
|
287
|
-
hasMore:
|
|
288
|
-
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)
|
|
289
309
|
})]
|
|
290
310
|
})
|
|
291
311
|
]
|
|
292
312
|
});
|
|
293
313
|
}
|
|
294
|
-
function
|
|
295
|
-
let
|
|
296
|
-
|
|
297
|
-
|
|
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" }),
|
|
298
321
|
title: "No members yet"
|
|
299
322
|
});
|
|
300
|
-
let
|
|
323
|
+
let c = async (t, n) => {
|
|
301
324
|
try {
|
|
302
|
-
await
|
|
325
|
+
await r.mutateAsync({
|
|
303
326
|
membershipId: t,
|
|
304
|
-
role:
|
|
327
|
+
role: n,
|
|
305
328
|
circleId: e.id
|
|
306
329
|
}), g.success("Role updated");
|
|
307
330
|
} catch (e) {
|
|
308
331
|
g.error("Could not update role", h(e));
|
|
309
332
|
}
|
|
310
|
-
};
|
|
311
|
-
return /* @__PURE__ */
|
|
312
|
-
className: "flex flex-col gap-
|
|
313
|
-
children:
|
|
314
|
-
className: "flex
|
|
315
|
-
children: [/* @__PURE__ */
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
children: /* @__PURE__ */ F(X, {})
|
|
328
|
-
}), /* @__PURE__ */ F(q, { children: Q.map((e) => /* @__PURE__ */ F(J, {
|
|
329
|
-
value: e,
|
|
330
|
-
children: v(e)
|
|
331
|
-
}, e)) })]
|
|
332
|
-
}) : /* @__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)}`
|
|
333
350
|
})]
|
|
334
|
-
},
|
|
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
|
+
})]
|
|
335
395
|
});
|
|
336
396
|
}
|
|
337
|
-
function
|
|
338
|
-
let { navigateTo: r } = e(), { data: i, isLoading: a, isError: s, refetch: c } = o({ circleId: t.id }), [l, u] =
|
|
339
|
-
return /* @__PURE__ */
|
|
340
|
-
/* @__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", {
|
|
341
401
|
className: "mb-4 flex items-center justify-end",
|
|
342
|
-
children: n && /* @__PURE__ */
|
|
402
|
+
children: n && /* @__PURE__ */ L(R, {
|
|
343
403
|
onClick: () => u(!0),
|
|
344
|
-
children: [/* @__PURE__ */
|
|
404
|
+
children: [/* @__PURE__ */ I(P, { className: "mr-1.5 h-4 w-4" }), " New event"]
|
|
345
405
|
})
|
|
346
406
|
}),
|
|
347
|
-
a ? /* @__PURE__ */
|
|
348
|
-
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" }),
|
|
349
409
|
title: "No events scheduled",
|
|
350
410
|
description: n ? "Schedule the first event for this circle." : "No upcoming events.",
|
|
351
|
-
action: n ? /* @__PURE__ */
|
|
411
|
+
action: n ? /* @__PURE__ */ L(R, {
|
|
352
412
|
onClick: () => u(!0),
|
|
353
|
-
children: [/* @__PURE__ */
|
|
413
|
+
children: [/* @__PURE__ */ I(P, { className: "mr-1.5 h-4 w-4" }), " New event"]
|
|
354
414
|
}) : void 0
|
|
355
|
-
}) : /* @__PURE__ */
|
|
415
|
+
}) : /* @__PURE__ */ I("div", {
|
|
356
416
|
className: "grid gap-4 md:grid-cols-2",
|
|
357
|
-
children: d.map((e) => /* @__PURE__ */
|
|
417
|
+
children: d.map((e) => /* @__PURE__ */ I(ne, {
|
|
358
418
|
event: e,
|
|
359
419
|
onOpen: () => r(`events/${e.id}`)
|
|
360
420
|
}, e.id))
|
|
361
421
|
}),
|
|
362
|
-
/* @__PURE__ */
|
|
422
|
+
/* @__PURE__ */ I(ie, {
|
|
363
423
|
circleId: t.id,
|
|
364
424
|
open: l,
|
|
365
425
|
onOpenChange: u
|
|
366
426
|
})
|
|
367
427
|
] });
|
|
368
428
|
}
|
|
369
|
-
function
|
|
370
|
-
let { data: r, isLoading: i, isError: a, refetch: o } = l(e.id), [s, c] =
|
|
371
|
-
return /* @__PURE__ */
|
|
372
|
-
/* @__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", {
|
|
373
433
|
className: "mb-4 flex items-center justify-end",
|
|
374
|
-
children: t && /* @__PURE__ */
|
|
434
|
+
children: t && /* @__PURE__ */ L(R, {
|
|
375
435
|
onClick: () => c(!0),
|
|
376
|
-
children: [/* @__PURE__ */
|
|
436
|
+
children: [/* @__PURE__ */ I(P, { className: "mr-1.5 h-4 w-4" }), " New poll"]
|
|
377
437
|
})
|
|
378
438
|
}),
|
|
379
|
-
i ? /* @__PURE__ */
|
|
380
|
-
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" }),
|
|
381
441
|
title: "No polls yet",
|
|
382
442
|
description: t ? "Ask the circle a question with a poll." : "No polls have been created.",
|
|
383
|
-
action: t ? /* @__PURE__ */
|
|
443
|
+
action: t ? /* @__PURE__ */ L(R, {
|
|
384
444
|
onClick: () => c(!0),
|
|
385
|
-
children: [/* @__PURE__ */
|
|
445
|
+
children: [/* @__PURE__ */ I(P, { className: "mr-1.5 h-4 w-4" }), " New poll"]
|
|
386
446
|
}) : void 0
|
|
387
|
-
}) : /* @__PURE__ */
|
|
447
|
+
}) : /* @__PURE__ */ I("div", {
|
|
388
448
|
className: "mx-auto flex max-w-2xl flex-col gap-4",
|
|
389
|
-
children: (r ?? []).map((e) => /* @__PURE__ */
|
|
449
|
+
children: (r ?? []).map((e) => /* @__PURE__ */ I(re, {
|
|
390
450
|
poll: e,
|
|
391
451
|
canManage: n
|
|
392
452
|
}, e.id))
|
|
393
453
|
}),
|
|
394
|
-
/* @__PURE__ */
|
|
454
|
+
/* @__PURE__ */ I(Ee, {
|
|
395
455
|
circleId: e.id,
|
|
396
456
|
open: s,
|
|
397
457
|
onOpenChange: c
|
|
398
458
|
})
|
|
399
459
|
] });
|
|
400
460
|
}
|
|
401
|
-
function
|
|
402
|
-
return /* @__PURE__ */
|
|
461
|
+
function Ce({ circle: e }) {
|
|
462
|
+
return /* @__PURE__ */ I("div", {
|
|
403
463
|
className: "mx-auto max-w-2xl",
|
|
404
|
-
children: /* @__PURE__ */
|
|
464
|
+
children: /* @__PURE__ */ L("div", {
|
|
405
465
|
className: "rounded-2xl border border-border-seam bg-bg-surface p-6",
|
|
406
466
|
children: [
|
|
407
|
-
/* @__PURE__ */
|
|
467
|
+
/* @__PURE__ */ I("h2", {
|
|
408
468
|
className: "text-lg font-semibold text-text-primary",
|
|
409
469
|
children: "About this circle"
|
|
410
470
|
}),
|
|
411
|
-
/* @__PURE__ */
|
|
471
|
+
/* @__PURE__ */ I("p", {
|
|
412
472
|
className: "mt-2 whitespace-pre-wrap text-sm text-text-secondary",
|
|
413
473
|
children: e.description || "No description provided."
|
|
414
474
|
}),
|
|
415
|
-
e.tags.length > 0 && /* @__PURE__ */
|
|
475
|
+
e.tags.length > 0 && /* @__PURE__ */ I("div", {
|
|
416
476
|
className: "mt-4 flex flex-wrap gap-1.5",
|
|
417
|
-
children: e.tags.map((e) => /* @__PURE__ */
|
|
477
|
+
children: e.tags.map((e) => /* @__PURE__ */ L("span", {
|
|
418
478
|
className: "rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs font-medium text-text-secondary",
|
|
419
479
|
children: ["#", e]
|
|
420
480
|
}, e))
|
|
421
481
|
}),
|
|
422
|
-
/* @__PURE__ */
|
|
482
|
+
/* @__PURE__ */ L("dl", {
|
|
423
483
|
className: "mt-6 grid grid-cols-2 gap-4 text-sm",
|
|
424
484
|
children: [
|
|
425
|
-
/* @__PURE__ */
|
|
485
|
+
/* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("dt", {
|
|
426
486
|
className: "text-text-tertiary",
|
|
427
487
|
children: "Visibility"
|
|
428
|
-
}), /* @__PURE__ */
|
|
488
|
+
}), /* @__PURE__ */ I("dd", {
|
|
429
489
|
className: "mt-1 text-text-primary",
|
|
430
490
|
children: v(e.visibility)
|
|
431
491
|
})] }),
|
|
432
|
-
/* @__PURE__ */
|
|
492
|
+
/* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("dt", {
|
|
433
493
|
className: "text-text-tertiary",
|
|
434
494
|
children: "Status"
|
|
435
|
-
}), /* @__PURE__ */
|
|
495
|
+
}), /* @__PURE__ */ I("dd", {
|
|
436
496
|
className: "mt-1 text-text-primary",
|
|
437
497
|
children: v(e.status)
|
|
438
498
|
})] }),
|
|
439
|
-
/* @__PURE__ */
|
|
499
|
+
/* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("dt", {
|
|
440
500
|
className: "text-text-tertiary",
|
|
441
501
|
children: "Members"
|
|
442
|
-
}), /* @__PURE__ */
|
|
502
|
+
}), /* @__PURE__ */ I("dd", {
|
|
443
503
|
className: "mt-1 text-text-primary",
|
|
444
504
|
children: y(e.memberCount)
|
|
445
505
|
})] }),
|
|
446
|
-
/* @__PURE__ */
|
|
506
|
+
/* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("dt", {
|
|
447
507
|
className: "text-text-tertiary",
|
|
448
508
|
children: "Created"
|
|
449
|
-
}), /* @__PURE__ */
|
|
509
|
+
}), /* @__PURE__ */ I("dd", {
|
|
450
510
|
className: "mt-1 text-text-primary",
|
|
451
511
|
children: _(e.createdAt)
|
|
452
512
|
})] })
|
|
@@ -456,70 +516,70 @@ function xe({ circle: e }) {
|
|
|
456
516
|
})
|
|
457
517
|
});
|
|
458
518
|
}
|
|
459
|
-
var
|
|
519
|
+
var we = [
|
|
460
520
|
"TEXT",
|
|
461
521
|
"FORUM",
|
|
462
522
|
"ANNOUNCEMENT",
|
|
463
523
|
"VOICE"
|
|
464
524
|
];
|
|
465
|
-
function
|
|
466
|
-
let a = i(), [o, s] =
|
|
467
|
-
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, {
|
|
468
528
|
open: t,
|
|
469
529
|
onOpenChange: n,
|
|
470
|
-
children: /* @__PURE__ */
|
|
530
|
+
children: /* @__PURE__ */ L(H, {
|
|
471
531
|
className: "sm:max-w-md",
|
|
472
532
|
children: [
|
|
473
|
-
/* @__PURE__ */
|
|
474
|
-
/* @__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", {
|
|
475
535
|
className: "flex flex-col gap-4 py-2",
|
|
476
536
|
children: [
|
|
477
|
-
/* @__PURE__ */
|
|
537
|
+
/* @__PURE__ */ L("div", {
|
|
478
538
|
className: "grid gap-1.5",
|
|
479
|
-
children: [/* @__PURE__ */
|
|
539
|
+
children: [/* @__PURE__ */ I(B, {
|
|
480
540
|
htmlFor: "channel-name",
|
|
481
541
|
children: "Name"
|
|
482
|
-
}), /* @__PURE__ */
|
|
542
|
+
}), /* @__PURE__ */ I(z, {
|
|
483
543
|
id: "channel-name",
|
|
484
544
|
value: o,
|
|
485
545
|
onChange: (e) => s(e.target.value),
|
|
486
546
|
placeholder: "general"
|
|
487
547
|
})]
|
|
488
548
|
}),
|
|
489
|
-
/* @__PURE__ */
|
|
549
|
+
/* @__PURE__ */ L("div", {
|
|
490
550
|
className: "grid gap-1.5",
|
|
491
|
-
children: [/* @__PURE__ */
|
|
551
|
+
children: [/* @__PURE__ */ I(B, { children: "Type" }), /* @__PURE__ */ L(q, {
|
|
492
552
|
value: u,
|
|
493
553
|
onValueChange: (e) => d(e),
|
|
494
|
-
children: [/* @__PURE__ */
|
|
554
|
+
children: [/* @__PURE__ */ I(X, { children: /* @__PURE__ */ I(Z, {}) }), /* @__PURE__ */ I(J, { children: we.map((e) => /* @__PURE__ */ I(Y, {
|
|
495
555
|
value: e,
|
|
496
556
|
children: v(e)
|
|
497
557
|
}, e)) })]
|
|
498
558
|
})]
|
|
499
559
|
}),
|
|
500
|
-
/* @__PURE__ */
|
|
560
|
+
/* @__PURE__ */ L("div", {
|
|
501
561
|
className: "grid gap-1.5",
|
|
502
|
-
children: [/* @__PURE__ */
|
|
562
|
+
children: [/* @__PURE__ */ I(B, {
|
|
503
563
|
htmlFor: "channel-desc",
|
|
504
564
|
children: "Description"
|
|
505
|
-
}), /* @__PURE__ */
|
|
565
|
+
}), /* @__PURE__ */ I(pe, {
|
|
506
566
|
id: "channel-desc",
|
|
507
567
|
value: c,
|
|
508
568
|
onChange: (e) => l(e.target.value),
|
|
509
569
|
rows: 2
|
|
510
570
|
})]
|
|
511
571
|
}),
|
|
512
|
-
f && /* @__PURE__ */
|
|
572
|
+
f && /* @__PURE__ */ I("p", {
|
|
513
573
|
className: "text-sm text-status-error-text",
|
|
514
574
|
children: f
|
|
515
575
|
})
|
|
516
576
|
]
|
|
517
577
|
}),
|
|
518
|
-
/* @__PURE__ */
|
|
578
|
+
/* @__PURE__ */ L(W, { children: [/* @__PURE__ */ I(R, {
|
|
519
579
|
variant: "outline",
|
|
520
580
|
onClick: () => n(!1),
|
|
521
581
|
children: "Cancel"
|
|
522
|
-
}), /* @__PURE__ */
|
|
582
|
+
}), /* @__PURE__ */ I(R, {
|
|
523
583
|
onClick: async () => {
|
|
524
584
|
if (!o.trim()) {
|
|
525
585
|
p("Channel name is required.");
|
|
@@ -529,7 +589,7 @@ function $({ circleId: e, open: t, onOpenChange: n, onCreated: r }) {
|
|
|
529
589
|
let t = await a.mutateAsync({
|
|
530
590
|
circleId: e,
|
|
531
591
|
name: o.trim(),
|
|
532
|
-
slug:
|
|
592
|
+
slug: ee(o),
|
|
533
593
|
description: c.trim() || null,
|
|
534
594
|
type: u
|
|
535
595
|
});
|
|
@@ -545,85 +605,135 @@ function $({ circleId: e, open: t, onOpenChange: n, onCreated: r }) {
|
|
|
545
605
|
})
|
|
546
606
|
});
|
|
547
607
|
}
|
|
548
|
-
function
|
|
549
|
-
let r = a(), [i, o] =
|
|
550
|
-
|
|
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);
|
|
551
614
|
};
|
|
552
|
-
return /* @__PURE__ */
|
|
615
|
+
return /* @__PURE__ */ I(V, {
|
|
553
616
|
open: t,
|
|
554
617
|
onOpenChange: n,
|
|
555
|
-
children: /* @__PURE__ */
|
|
618
|
+
children: /* @__PURE__ */ L(H, {
|
|
556
619
|
className: "sm:max-w-md",
|
|
557
620
|
children: [
|
|
558
|
-
/* @__PURE__ */
|
|
559
|
-
/* @__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", {
|
|
560
623
|
className: "flex flex-col gap-4 py-2",
|
|
561
624
|
children: [
|
|
562
|
-
/* @__PURE__ */
|
|
625
|
+
/* @__PURE__ */ L("div", {
|
|
563
626
|
className: "grid gap-1.5",
|
|
564
|
-
children: [/* @__PURE__ */
|
|
627
|
+
children: [/* @__PURE__ */ I(B, {
|
|
565
628
|
htmlFor: "poll-q",
|
|
566
629
|
children: "Question"
|
|
567
|
-
}), /* @__PURE__ */
|
|
630
|
+
}), /* @__PURE__ */ I(z, {
|
|
568
631
|
id: "poll-q",
|
|
569
632
|
value: i,
|
|
570
633
|
onChange: (e) => o(e.target.value),
|
|
571
634
|
placeholder: "What should we build next?"
|
|
572
635
|
})]
|
|
573
636
|
}),
|
|
574
|
-
/* @__PURE__ */
|
|
637
|
+
/* @__PURE__ */ L("div", {
|
|
575
638
|
className: "grid gap-1.5",
|
|
576
|
-
children: [/* @__PURE__ */
|
|
639
|
+
children: [/* @__PURE__ */ I(B, { children: "Options" }), /* @__PURE__ */ L("div", {
|
|
577
640
|
className: "flex flex-col gap-2",
|
|
578
|
-
children: [s.map((e, t) => /* @__PURE__ */
|
|
641
|
+
children: [s.map((e, t) => /* @__PURE__ */ L("div", {
|
|
579
642
|
className: "flex items-center gap-2",
|
|
580
|
-
children: [/* @__PURE__ */
|
|
643
|
+
children: [/* @__PURE__ */ I(z, {
|
|
581
644
|
value: e,
|
|
582
645
|
onChange: (e) => c((n) => n.map((n, r) => r === t ? e.target.value : n)),
|
|
583
646
|
placeholder: `Option ${t + 1}`
|
|
584
|
-
}), s.length > 2 && /* @__PURE__ */
|
|
647
|
+
}), s.length > 2 && /* @__PURE__ */ I(R, {
|
|
585
648
|
variant: "ghost",
|
|
586
649
|
size: "icon",
|
|
587
650
|
onClick: () => c((e) => e.filter((e, n) => n !== t)),
|
|
588
651
|
"aria-label": `Remove option ${t + 1}`,
|
|
589
652
|
children: "✕"
|
|
590
653
|
})]
|
|
591
|
-
}, t)), s.length < 8 && /* @__PURE__ */
|
|
654
|
+
}, t)), s.length < 8 && /* @__PURE__ */ L(R, {
|
|
592
655
|
variant: "outline",
|
|
593
656
|
size: "sm",
|
|
594
657
|
onClick: () => c((e) => [...e, ""]),
|
|
595
|
-
children: [/* @__PURE__ */
|
|
658
|
+
children: [/* @__PURE__ */ I(P, { className: "mr-1.5 h-4 w-4" }), " Add option"]
|
|
596
659
|
})]
|
|
597
660
|
})]
|
|
598
661
|
}),
|
|
599
|
-
/* @__PURE__ */
|
|
600
|
-
className: "
|
|
601
|
-
children: [
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
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
|
+
})]
|
|
607
717
|
}),
|
|
608
|
-
|
|
718
|
+
_ && /* @__PURE__ */ I("p", {
|
|
609
719
|
className: "text-sm text-status-error-text",
|
|
610
|
-
children:
|
|
720
|
+
children: _
|
|
611
721
|
})
|
|
612
722
|
]
|
|
613
723
|
}),
|
|
614
|
-
/* @__PURE__ */
|
|
724
|
+
/* @__PURE__ */ L(W, { children: [/* @__PURE__ */ I(R, {
|
|
615
725
|
variant: "outline",
|
|
616
726
|
onClick: () => n(!1),
|
|
617
727
|
children: "Cancel"
|
|
618
|
-
}), /* @__PURE__ */
|
|
728
|
+
}), /* @__PURE__ */ I(R, {
|
|
619
729
|
onClick: async () => {
|
|
620
730
|
let t = s.map((e) => e.trim()).filter(Boolean);
|
|
621
731
|
if (!i.trim()) {
|
|
622
|
-
|
|
732
|
+
v("A question is required.");
|
|
623
733
|
return;
|
|
624
734
|
}
|
|
625
735
|
if (t.length < 2) {
|
|
626
|
-
|
|
736
|
+
v("Add at least two options.");
|
|
627
737
|
return;
|
|
628
738
|
}
|
|
629
739
|
try {
|
|
@@ -631,10 +741,12 @@ function Ce({ circleId: e, open: t, onOpenChange: n }) {
|
|
|
631
741
|
circleId: e,
|
|
632
742
|
question: i.trim(),
|
|
633
743
|
options: t,
|
|
634
|
-
allowMultiple: l
|
|
635
|
-
|
|
744
|
+
allowMultiple: l,
|
|
745
|
+
isAnonymous: d,
|
|
746
|
+
closesAt: p ? new Date(p).toISOString() : null
|
|
747
|
+
}), g.success("Poll created"), n(!1), b();
|
|
636
748
|
} catch (e) {
|
|
637
|
-
|
|
749
|
+
v(h(e));
|
|
638
750
|
}
|
|
639
751
|
},
|
|
640
752
|
disabled: r.isPending,
|
|
@@ -645,6 +757,6 @@ function Ce({ circleId: e, open: t, onOpenChange: n }) {
|
|
|
645
757
|
});
|
|
646
758
|
}
|
|
647
759
|
//#endregion
|
|
648
|
-
export {
|
|
760
|
+
export { _e as CircleDetailPage };
|
|
649
761
|
|
|
650
762
|
//# sourceMappingURL=CircleDetailPage.js.map
|