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