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