@burdenoff/microfe-comradecircle 2026.830.1 → 2026.1025.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/MetricsCard.js +64 -0
- package/dist/comradecircle/components/MetricsCard.js.map +1 -0
- package/dist/comradecircle/components/StatusBadge.d.ts.map +1 -1
- package/dist/comradecircle/components/StatusBadge.js +4 -0
- package/dist/comradecircle/components/StatusBadge.js.map +1 -1
- package/dist/comradecircle/hooks/index.d.ts +1 -0
- package/dist/comradecircle/hooks/index.d.ts.map +1 -1
- package/dist/comradecircle/hooks/index.js +1 -0
- package/dist/comradecircle/hooks/useComradeCircleApi.d.ts +6 -0
- package/dist/comradecircle/hooks/useComradeCircleApi.d.ts.map +1 -1
- package/dist/comradecircle/hooks/useComradeCircleApi.js +1 -1
- package/dist/comradecircle/hooks/useComradeCircleApi.js.map +1 -1
- package/dist/comradecircle/hooks/useModerationApi.d.ts +19 -0
- package/dist/comradecircle/hooks/useModerationApi.d.ts.map +1 -0
- package/dist/comradecircle/hooks/useModerationApi.js +101 -0
- package/dist/comradecircle/hooks/useModerationApi.js.map +1 -0
- package/dist/comradecircle/pages/circles/CircleDetailPage.d.ts +1 -0
- package/dist/comradecircle/pages/circles/CircleDetailPage.d.ts.map +1 -1
- package/dist/comradecircle/pages/circles/CircleDetailPage.js +91 -77
- package/dist/comradecircle/pages/circles/CircleDetailPage.js.map +1 -1
- package/dist/comradecircle/pages/circles/ModerationTab.d.ts +7 -0
- package/dist/comradecircle/pages/circles/ModerationTab.d.ts.map +1 -0
- package/dist/comradecircle/pages/circles/ModerationTab.js +429 -0
- package/dist/comradecircle/pages/circles/ModerationTab.js.map +1 -0
- package/dist/comradecircle/pages/events/EventsPage.js +6 -6
- package/dist/comradecircle/types/index.d.ts +53 -0
- package/dist/comradecircle/types/index.d.ts.map +1 -1
- package/dist/generated/global-types.d.ts +9105 -562
- package/dist/generated/global-types.d.ts.map +1 -1
- package/dist/generated/wspace-types.d.ts +103018 -27116
- package/dist/generated/wspace-types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { useComradeCircle as e } from "../context/ComradeCircleContext.js";
|
|
2
|
+
import "../context/index.js";
|
|
3
|
+
import { comQuery as t } from "./useComradeCircleApi.js";
|
|
4
|
+
import { useMutation as n, useQuery as r, useQueryClient as i } from "@tanstack/react-query";
|
|
5
|
+
//#region src/comradecircle/hooks/useModerationApi.ts
|
|
6
|
+
var a = {
|
|
7
|
+
verdicts: (e) => [
|
|
8
|
+
"comradecircle",
|
|
9
|
+
"moderation",
|
|
10
|
+
"verdicts",
|
|
11
|
+
e
|
|
12
|
+
],
|
|
13
|
+
rule: (e) => [
|
|
14
|
+
"comradecircle",
|
|
15
|
+
"moderation",
|
|
16
|
+
"rule",
|
|
17
|
+
e
|
|
18
|
+
],
|
|
19
|
+
summary: (e, t) => [
|
|
20
|
+
"comradecircle",
|
|
21
|
+
"moderation",
|
|
22
|
+
"summary",
|
|
23
|
+
e,
|
|
24
|
+
t
|
|
25
|
+
]
|
|
26
|
+
}, o = "\n id workspaceId circleId targetType targetId verdict categories confidence rationale\n actedAutomatically injectionDetected reviewedBy reviewedAt reviewNote overturned createdAt\n", s = "\n id workspaceId circleId enabled flaggedTerms spamPatterns toxicityThreshold autoHideSpam updatedAt\n", c = (n, i = {}, s = !0) => {
|
|
27
|
+
let { apiGatewayUrl: c } = e();
|
|
28
|
+
return r({
|
|
29
|
+
queryKey: [...a.verdicts(n ?? ""), i],
|
|
30
|
+
enabled: !!n && s,
|
|
31
|
+
queryFn: async () => (await t(`query ComListVerdicts($circleId: ID, $verdict: ComModerationVerdictType, $reviewed: Boolean, $pagination: PaginationInput) {
|
|
32
|
+
comListVerdicts(circleId: $circleId, verdict: $verdict, reviewed: $reviewed, pagination: $pagination) {
|
|
33
|
+
items { ${o} }
|
|
34
|
+
}
|
|
35
|
+
}`, {
|
|
36
|
+
circleId: n,
|
|
37
|
+
verdict: i.verdict,
|
|
38
|
+
reviewed: i.reviewed,
|
|
39
|
+
pagination: { limit: 50 }
|
|
40
|
+
}, c)).comListVerdicts.items
|
|
41
|
+
});
|
|
42
|
+
}, l = (r) => {
|
|
43
|
+
let { apiGatewayUrl: s } = e(), c = i();
|
|
44
|
+
return n({
|
|
45
|
+
mutationFn: async (e) => (await t(`mutation ComReviewVerdict($verdictId: ID!, $decision: ComModerationReviewDecision!, $note: String) {
|
|
46
|
+
comReviewVerdict(verdictId: $verdictId, decision: $decision, note: $note) { ${o} }
|
|
47
|
+
}`, {
|
|
48
|
+
verdictId: e.verdictId,
|
|
49
|
+
decision: e.decision,
|
|
50
|
+
note: e.note || void 0
|
|
51
|
+
}, s)).comReviewVerdict,
|
|
52
|
+
onSuccess: (e) => {
|
|
53
|
+
c.invalidateQueries({ queryKey: a.verdicts(r) }), c.invalidateQueries({ queryKey: [
|
|
54
|
+
"comradecircle",
|
|
55
|
+
"moderation",
|
|
56
|
+
"summary",
|
|
57
|
+
r
|
|
58
|
+
] }), e.targetType === "POST" && (c.invalidateQueries({ queryKey: [
|
|
59
|
+
"comradecircle",
|
|
60
|
+
"post",
|
|
61
|
+
e.targetId
|
|
62
|
+
] }), c.invalidateQueries({ queryKey: ["comradecircle", "posts"] }), c.invalidateQueries({ queryKey: ["comradecircle", "feed"] }));
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}, u = (n, i = !0) => {
|
|
66
|
+
let { apiGatewayUrl: o } = e();
|
|
67
|
+
return r({
|
|
68
|
+
queryKey: a.rule(n ?? ""),
|
|
69
|
+
enabled: !!n && i,
|
|
70
|
+
queryFn: async () => (await t(`query ComModerationRule($circleId: ID!) {
|
|
71
|
+
comModerationRule(circleId: $circleId) { ${s} }
|
|
72
|
+
}`, { circleId: n }, o)).comModerationRule
|
|
73
|
+
});
|
|
74
|
+
}, d = (r) => {
|
|
75
|
+
let { apiGatewayUrl: o } = e(), c = i();
|
|
76
|
+
return n({
|
|
77
|
+
mutationFn: async (e) => (await t(`mutation ComUpdateModerationRule($circleId: ID!, $input: ComModerationRuleInput!) {
|
|
78
|
+
comUpdateModerationRule(circleId: $circleId, input: $input) { ${s} }
|
|
79
|
+
}`, {
|
|
80
|
+
circleId: r,
|
|
81
|
+
input: e
|
|
82
|
+
}, o)).comUpdateModerationRule,
|
|
83
|
+
onSuccess: (e) => {
|
|
84
|
+
c.setQueryData(a.rule(r), e);
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
}, f = (n, i, o = !0) => {
|
|
88
|
+
let { apiGatewayUrl: s } = e();
|
|
89
|
+
return r({
|
|
90
|
+
queryKey: a.summary(n ?? "", i),
|
|
91
|
+
enabled: !!n && o,
|
|
92
|
+
queryFn: async () => (await t("query ComCircleActivitySummary($circleId: ID!, $days: Int) {\n comCircleActivitySummary(circleId: $circleId, days: $days) {\n periodStart periodEnd totalPosts totalComments newMembers activeMembers\n verdictCounts { verdict count } summaryText\n }\n }", {
|
|
93
|
+
circleId: n,
|
|
94
|
+
days: i
|
|
95
|
+
}, s)).comCircleActivitySummary
|
|
96
|
+
});
|
|
97
|
+
};
|
|
98
|
+
//#endregion
|
|
99
|
+
export { f as useComCircleActivitySummary, c as useComCircleVerdicts, u as useComModerationRule, l as useComReviewVerdict, d as useComUpdateModerationRule };
|
|
100
|
+
|
|
101
|
+
//# sourceMappingURL=useModerationApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useModerationApi.js","names":[],"sources":["../../../src/comradecircle/hooks/useModerationApi.ts"],"sourcesContent":["/**\n * Moderation API hooks\n * @module comradecircle/hooks\n *\n * The moderator console for one circle (BOFF-4451): the triage verdict queue\n * with its suggested actions, the human review gate, the per-circle\n * auto-moderation rule and the circle activity summary. Every operation maps\n * 1:1 to a `com*` field in the svc moderation schema; the svc enforces the\n * circle-role checks (MODERATOR+ to read, ADMIN+ to edit rules).\n */\n\nimport { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';\n\nimport { useComradeCircle } from '../context';\nimport type {\n ComCircleActivitySummary,\n ComModerationReviewDecision,\n ComModerationRule,\n ComModerationRuleInput,\n ComModerationVerdict,\n ComModerationVerdictType,\n} from '../types';\nimport { comQuery } from './useComradeCircleApi';\n\nconst MODERATION_KEY = {\n verdicts: (circleId: string) => ['comradecircle', 'moderation', 'verdicts', circleId] as const,\n rule: (circleId: string) => ['comradecircle', 'moderation', 'rule', circleId] as const,\n summary: (circleId: string, days: number) =>\n ['comradecircle', 'moderation', 'summary', circleId, days] as const,\n};\n\nconst VERDICT_FIELDS = `\n id workspaceId circleId targetType targetId verdict categories confidence rationale\n actedAutomatically injectionDetected reviewedBy reviewedAt reviewNote overturned createdAt\n`;\n\nconst RULE_FIELDS = `\n id workspaceId circleId enabled flaggedTerms spamPatterns toxicityThreshold autoHideSpam updatedAt\n`;\n\n/** Page size of the moderator queue; the svc clamps larger requests anyway. */\nexport const VERDICT_QUEUE_LIMIT = 50;\n\nexport interface VerdictQueueFilters {\n /** `false` = needs review, `true` = already reviewed, undefined = all. */\n reviewed?: boolean;\n verdict?: ComModerationVerdictType;\n}\n\nexport const useComCircleVerdicts = (\n circleId: string | undefined,\n filters: VerdictQueueFilters = {},\n enabled = true\n) => {\n const { apiGatewayUrl } = useComradeCircle();\n return useQuery({\n queryKey: [...MODERATION_KEY.verdicts(circleId ?? ''), filters],\n enabled: Boolean(circleId) && enabled,\n queryFn: async () => {\n const result = await comQuery<{ comListVerdicts: { items: ComModerationVerdict[] } }>(\n `query ComListVerdicts($circleId: ID, $verdict: ComModerationVerdictType, $reviewed: Boolean, $pagination: PaginationInput) {\n comListVerdicts(circleId: $circleId, verdict: $verdict, reviewed: $reviewed, pagination: $pagination) {\n items { ${VERDICT_FIELDS} }\n }\n }`,\n {\n circleId,\n verdict: filters.verdict,\n reviewed: filters.reviewed,\n pagination: { limit: VERDICT_QUEUE_LIMIT },\n },\n apiGatewayUrl\n );\n return result.comListVerdicts.items;\n },\n });\n};\n\nexport const useComReviewVerdict = (circleId: string) => {\n const { apiGatewayUrl } = useComradeCircle();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (vars: {\n verdictId: string;\n decision: ComModerationReviewDecision;\n note?: string;\n }) => {\n const result = await comQuery<{ comReviewVerdict: ComModerationVerdict }>(\n `mutation ComReviewVerdict($verdictId: ID!, $decision: ComModerationReviewDecision!, $note: String) {\n comReviewVerdict(verdictId: $verdictId, decision: $decision, note: $note) { ${VERDICT_FIELDS} }\n }`,\n { verdictId: vars.verdictId, decision: vars.decision, note: vars.note || undefined },\n apiGatewayUrl\n );\n return result.comReviewVerdict;\n },\n onSuccess: (verdict) => {\n qc.invalidateQueries({ queryKey: MODERATION_KEY.verdicts(circleId) });\n qc.invalidateQueries({ queryKey: ['comradecircle', 'moderation', 'summary', circleId] });\n // An overturn restores the post: refresh it wherever it is rendered.\n if (verdict.targetType === 'POST') {\n qc.invalidateQueries({ queryKey: ['comradecircle', 'post', verdict.targetId] });\n qc.invalidateQueries({ queryKey: ['comradecircle', 'posts'] });\n qc.invalidateQueries({ queryKey: ['comradecircle', 'feed'] });\n }\n },\n });\n};\n\nexport const useComModerationRule = (circleId: string | undefined, enabled = true) => {\n const { apiGatewayUrl } = useComradeCircle();\n return useQuery({\n queryKey: MODERATION_KEY.rule(circleId ?? ''),\n enabled: Boolean(circleId) && enabled,\n queryFn: async () => {\n const result = await comQuery<{ comModerationRule: ComModerationRule | null }>(\n `query ComModerationRule($circleId: ID!) {\n comModerationRule(circleId: $circleId) { ${RULE_FIELDS} }\n }`,\n { circleId },\n apiGatewayUrl\n );\n return result.comModerationRule;\n },\n });\n};\n\nexport const useComUpdateModerationRule = (circleId: string) => {\n const { apiGatewayUrl } = useComradeCircle();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (input: ComModerationRuleInput) => {\n const result = await comQuery<{ comUpdateModerationRule: ComModerationRule }>(\n `mutation ComUpdateModerationRule($circleId: ID!, $input: ComModerationRuleInput!) {\n comUpdateModerationRule(circleId: $circleId, input: $input) { ${RULE_FIELDS} }\n }`,\n { circleId, input },\n apiGatewayUrl\n );\n return result.comUpdateModerationRule;\n },\n onSuccess: (rule) => {\n qc.setQueryData(MODERATION_KEY.rule(circleId), rule);\n },\n });\n};\n\nexport const useComCircleActivitySummary = (\n circleId: string | undefined,\n days: number,\n enabled = true\n) => {\n const { apiGatewayUrl } = useComradeCircle();\n return useQuery({\n queryKey: MODERATION_KEY.summary(circleId ?? '', days),\n enabled: Boolean(circleId) && enabled,\n queryFn: async () => {\n const result = await comQuery<{ comCircleActivitySummary: ComCircleActivitySummary | null }>(\n `query ComCircleActivitySummary($circleId: ID!, $days: Int) {\n comCircleActivitySummary(circleId: $circleId, days: $days) {\n periodStart periodEnd totalPosts totalComments newMembers activeMembers\n verdictCounts { verdict count } summaryText\n }\n }`,\n { circleId, days },\n apiGatewayUrl\n );\n return result.comCircleActivitySummary;\n },\n });\n};\n"],"mappings":";;;;;AAwBA,IAAM,IAAiB;CACrB,WAAW,MAAqB;EAAC;EAAiB;EAAc;EAAY;CAAQ;CACpF,OAAO,MAAqB;EAAC;EAAiB;EAAc;EAAQ;CAAQ;CAC5E,UAAU,GAAkB,MAC1B;EAAC;EAAiB;EAAc;EAAW;EAAU;CAAI;AAC7D,GAEM,IAAiB,2LAKjB,IAAc,4GAaP,KACX,GACA,IAA+B,CAAC,GAChC,IAAU,OACP;CACH,IAAM,EAAE,qBAAkB,EAAiB;CAC3C,OAAO,EAAS;EACd,UAAU,CAAC,GAAG,EAAe,SAAS,KAAY,EAAE,GAAG,CAAO;EAC9D,SAAS,EAAQ,KAAa;EAC9B,SAAS,aAeA,MAdc,EACnB;;sBAEc,EAAe;;YAG7B;GACE;GACA,SAAS,EAAQ;GACjB,UAAU,EAAQ;GAClB,YAAY,EAAE,OAAA,GAA2B;EAC3C,GACA,CACF,GACc,gBAAgB;CAElC,CAAC;AACH,GAEa,KAAuB,MAAqB;CACvD,IAAM,EAAE,qBAAkB,EAAiB,GACrC,IAAK,EAAe;CAC1B,OAAO,EAAY;EACjB,YAAY,OAAO,OAYV,MAPc,EACnB;wFACgF,EAAe;YAE/F;GAAE,WAAW,EAAK;GAAW,UAAU,EAAK;GAAU,MAAM,EAAK,QAAQ,KAAA;EAAU,GACnF,CACF,GACc;EAEhB,YAAY,MAAY;GAItB,AAHA,EAAG,kBAAkB,EAAE,UAAU,EAAe,SAAS,CAAQ,EAAE,CAAC,GACpE,EAAG,kBAAkB,EAAE,UAAU;IAAC;IAAiB;IAAc;IAAW;GAAQ,EAAE,CAAC,GAEnF,EAAQ,eAAe,WACzB,EAAG,kBAAkB,EAAE,UAAU;IAAC;IAAiB;IAAQ,EAAQ;GAAQ,EAAE,CAAC,GAC9E,EAAG,kBAAkB,EAAE,UAAU,CAAC,iBAAiB,OAAO,EAAE,CAAC,GAC7D,EAAG,kBAAkB,EAAE,UAAU,CAAC,iBAAiB,MAAM,EAAE,CAAC;EAEhE;CACF,CAAC;AACH,GAEa,KAAwB,GAA8B,IAAU,OAAS;CACpF,IAAM,EAAE,qBAAkB,EAAiB;CAC3C,OAAO,EAAS;EACd,UAAU,EAAe,KAAK,KAAY,EAAE;EAC5C,SAAS,EAAQ,KAAa;EAC9B,SAAS,aAQA,MAPc,EACnB;qDAC6C,EAAY;YAEzD,EAAE,YAAS,GACX,CACF,GACc;CAElB,CAAC;AACH,GAEa,KAA8B,MAAqB;CAC9D,IAAM,EAAE,qBAAkB,EAAiB,GACrC,IAAK,EAAe;CAC1B,OAAO,EAAY;EACjB,YAAY,OAAO,OAQV,MAPc,EACnB;0EACkE,EAAY;YAE9E;GAAE;GAAU;EAAM,GAClB,CACF,GACc;EAEhB,YAAY,MAAS;GACnB,EAAG,aAAa,EAAe,KAAK,CAAQ,GAAG,CAAI;EACrD;CACF,CAAC;AACH,GAEa,KACX,GACA,GACA,IAAU,OACP;CACH,IAAM,EAAE,qBAAkB,EAAiB;CAC3C,OAAO,EAAS;EACd,UAAU,EAAe,QAAQ,KAAY,IAAI,CAAI;EACrD,SAAS,EAAQ,KAAa;EAC9B,SAAS,aAWA,MAVc,EACnB,8SAMA;GAAE;GAAU;EAAK,GACjB,CACF,GACc;CAElB,CAAC;AACH"}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* `comListPolls`. Writes join/leave, create channel, create poll, set member
|
|
7
7
|
* role (via the shared cards/dialogs). The channel post feed is the heart of the
|
|
8
8
|
* page; roles gate management actions (OWNER/ADMIN manage; members post).
|
|
9
|
+
* MODERATOR+ also get the Moderation tab (AI triage queue, rules, summary).
|
|
9
10
|
*/
|
|
10
11
|
export declare function CircleDetailPage(): import("react/jsx-runtime").JSX.Element;
|
|
11
12
|
//# sourceMappingURL=CircleDetailPage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CircleDetailPage.d.ts","sourceRoot":"","sources":["../../../../src/comradecircle/pages/circles/CircleDetailPage.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"CircleDetailPage.d.ts","sourceRoot":"","sources":["../../../../src/comradecircle/pages/circles/CircleDetailPage.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AA+FH,wBAAgB,gBAAgB,4CAuK/B"}
|
|
@@ -17,30 +17,35 @@ import { Pagination as E } from "../../components/Pagination.js";
|
|
|
17
17
|
import { slugify as D } from "../../utils/slug.js";
|
|
18
18
|
import { StatusBadge as O } from "../../components/StatusBadge.js";
|
|
19
19
|
import { Tabs as ee } from "../../components/Tabs.js";
|
|
20
|
+
import { ModerationTab as te } from "./ModerationTab.js";
|
|
20
21
|
import { PostComposer as k } from "../../components/PostComposer.js";
|
|
21
|
-
import { DraftsPanel as
|
|
22
|
-
import { EventCard as
|
|
23
|
-
import { PollCard as
|
|
24
|
-
import { CreateEventDialog as
|
|
22
|
+
import { DraftsPanel as ne } from "../../components/DraftsPanel.js";
|
|
23
|
+
import { EventCard as re } from "../../components/EventCard.js";
|
|
24
|
+
import { PollCard as ie } from "../../components/PollCard.js";
|
|
25
|
+
import { CreateEventDialog as ae } from "../../components/CreateEventDialog.js";
|
|
25
26
|
import { useMemo as A, useState as j } from "react";
|
|
26
|
-
import { ArrowLeft as
|
|
27
|
-
import { useParams as
|
|
27
|
+
import { ArrowLeft as oe, BarChart3 as M, CalendarDays as N, Hash as P, Info as se, Megaphone as F, MessageCircle as ce, MessagesSquare as le, Mic as ue, Plus as I, Search as de, ShieldCheck as fe, Users as L } from "lucide-react";
|
|
28
|
+
import { useParams as pe } from "react-router";
|
|
28
29
|
import { Fragment as R, jsx as z, jsxs as B } from "react/jsx-runtime";
|
|
29
|
-
import { Button as V, GradientText as
|
|
30
|
+
import { Button as V, GradientText as me, Input as H, Label as U, ResponsiveDialog as W, ResponsiveDialogContent as G, ResponsiveDialogDescription as K, ResponsiveDialogFooter as he, ResponsiveDialogHeader as ge, ResponsiveDialogTitle as _e, Select as q, SelectContent as J, SelectItem as Y, SelectTrigger as X, SelectValue as Z, Switch as ve, Textarea as ye } from "@burdenoff/fe-libs/ui";
|
|
30
31
|
//#region src/comradecircle/pages/circles/CircleDetailPage.tsx
|
|
31
|
-
var
|
|
32
|
-
TEXT:
|
|
32
|
+
var be = {
|
|
33
|
+
TEXT: P,
|
|
33
34
|
FORUM: le,
|
|
34
|
-
ANNOUNCEMENT:
|
|
35
|
-
VOICE:
|
|
36
|
-
},
|
|
35
|
+
ANNOUNCEMENT: F,
|
|
36
|
+
VOICE: ue
|
|
37
|
+
}, xe = ["OWNER", "ADMIN"], Se = [
|
|
38
|
+
"OWNER",
|
|
39
|
+
"ADMIN",
|
|
40
|
+
"MODERATOR"
|
|
41
|
+
], Q = [
|
|
37
42
|
"OWNER",
|
|
38
43
|
"ADMIN",
|
|
39
44
|
"MODERATOR",
|
|
40
45
|
"MEMBER"
|
|
41
|
-
],
|
|
42
|
-
function
|
|
43
|
-
let n = f(), { id: r } =
|
|
46
|
+
], Ce = 15;
|
|
47
|
+
function we() {
|
|
48
|
+
let n = f(), { id: r } = pe(), { currentUser: i, navigateTo: s } = e(), { data: c, isLoading: l, isError: u, refetch: d } = t(r), p = a(), g = o(), [y, b] = j("channels"), S = A(() => c?.memberships?.find((e) => e.memberId === i?.id && e.status === "ACTIVE"), [c, i]), C = !!S, E = S ? xe.includes(S.role) : !1, D = S ? Se.includes(S.role) : !1;
|
|
44
49
|
if (l) return /* @__PURE__ */ z(m, {
|
|
45
50
|
title: n("comradecircle.pages.circleDetail.title", "Circle"),
|
|
46
51
|
children: /* @__PURE__ */ z(T, { label: n("comradecircle.pages.circleDetail.loadingCircle", "Loading circle…") })
|
|
@@ -53,23 +58,23 @@ function be() {
|
|
|
53
58
|
onRetry: () => d()
|
|
54
59
|
})
|
|
55
60
|
});
|
|
56
|
-
let
|
|
61
|
+
let k = c.memberships?.filter((e) => e.status === "ACTIVE") ?? [], ne = [
|
|
57
62
|
{
|
|
58
63
|
value: "channels",
|
|
59
64
|
label: n("comradecircle.pages.circleDetail.tabChannels", "Channels"),
|
|
60
|
-
icon: /* @__PURE__ */ z(
|
|
65
|
+
icon: /* @__PURE__ */ z(P, { className: "h-4 w-4" }),
|
|
61
66
|
count: c.channels?.length ?? 0
|
|
62
67
|
},
|
|
63
68
|
{
|
|
64
69
|
value: "members",
|
|
65
70
|
label: n("comradecircle.pages.circleDetail.tabMembers", "Members"),
|
|
66
71
|
icon: /* @__PURE__ */ z(L, { className: "h-4 w-4" }),
|
|
67
|
-
count:
|
|
72
|
+
count: k.length
|
|
68
73
|
},
|
|
69
74
|
{
|
|
70
75
|
value: "events",
|
|
71
76
|
label: n("comradecircle.pages.circleDetail.tabEvents", "Events"),
|
|
72
|
-
icon: /* @__PURE__ */ z(
|
|
77
|
+
icon: /* @__PURE__ */ z(N, { className: "h-4 w-4" })
|
|
73
78
|
},
|
|
74
79
|
{
|
|
75
80
|
value: "polls",
|
|
@@ -80,7 +85,12 @@ function be() {
|
|
|
80
85
|
value: "about",
|
|
81
86
|
label: n("comradecircle.pages.circleDetail.tabAbout", "About"),
|
|
82
87
|
icon: /* @__PURE__ */ z(se, { className: "h-4 w-4" })
|
|
83
|
-
}
|
|
88
|
+
},
|
|
89
|
+
...D ? [{
|
|
90
|
+
value: "moderation",
|
|
91
|
+
label: n("comradecircle.pages.circleDetail.tabModeration", "Moderation"),
|
|
92
|
+
icon: /* @__PURE__ */ z(fe, { className: "h-4 w-4" })
|
|
93
|
+
}] : []
|
|
84
94
|
];
|
|
85
95
|
return /* @__PURE__ */ B(m, {
|
|
86
96
|
title: /* @__PURE__ */ B("span", {
|
|
@@ -91,7 +101,7 @@ function be() {
|
|
|
91
101
|
fileId: c.avatar?.id,
|
|
92
102
|
seed: c.id,
|
|
93
103
|
ring: !0
|
|
94
|
-
}), /* @__PURE__ */ z(
|
|
104
|
+
}), /* @__PURE__ */ z(me, {
|
|
95
105
|
as: "span",
|
|
96
106
|
className: "text-2xl font-semibold tracking-tight",
|
|
97
107
|
children: c.name
|
|
@@ -106,7 +116,7 @@ function be() {
|
|
|
106
116
|
size: "sm",
|
|
107
117
|
onClick: () => s("circles"),
|
|
108
118
|
children: [
|
|
109
|
-
/* @__PURE__ */ z(
|
|
119
|
+
/* @__PURE__ */ z(oe, { className: "mr-1.5 h-4 w-4" }),
|
|
110
120
|
" ",
|
|
111
121
|
n("common.back", "Back")
|
|
112
122
|
]
|
|
@@ -139,37 +149,41 @@ function be() {
|
|
|
139
149
|
]
|
|
140
150
|
}),
|
|
141
151
|
/* @__PURE__ */ z(ee, {
|
|
142
|
-
items:
|
|
152
|
+
items: ne,
|
|
143
153
|
value: y,
|
|
144
154
|
onChange: b,
|
|
145
155
|
className: "mb-5"
|
|
146
156
|
}),
|
|
147
|
-
y === "channels" && /* @__PURE__ */ z(
|
|
157
|
+
y === "channels" && /* @__PURE__ */ z(Te, {
|
|
148
158
|
circle: c,
|
|
149
159
|
isMember: C,
|
|
150
160
|
canManage: E
|
|
151
161
|
}),
|
|
152
|
-
y === "members" && /* @__PURE__ */ z(
|
|
162
|
+
y === "members" && /* @__PURE__ */ z(De, {
|
|
153
163
|
circle: c,
|
|
154
164
|
canManage: E
|
|
155
165
|
}),
|
|
156
|
-
y === "events" && /* @__PURE__ */ z(
|
|
166
|
+
y === "events" && /* @__PURE__ */ z(Oe, {
|
|
157
167
|
circle: c,
|
|
158
168
|
isMember: C
|
|
159
169
|
}),
|
|
160
|
-
y === "polls" && /* @__PURE__ */ z(
|
|
170
|
+
y === "polls" && /* @__PURE__ */ z(ke, {
|
|
161
171
|
circle: c,
|
|
162
172
|
isMember: C,
|
|
163
173
|
canManage: E
|
|
164
174
|
}),
|
|
165
|
-
y === "about" && /* @__PURE__ */ z(
|
|
175
|
+
y === "about" && /* @__PURE__ */ z(Ae, { circle: c }),
|
|
176
|
+
y === "moderation" && D && /* @__PURE__ */ z(te, {
|
|
177
|
+
circle: c,
|
|
178
|
+
canEditRules: E
|
|
179
|
+
})
|
|
166
180
|
]
|
|
167
181
|
});
|
|
168
182
|
}
|
|
169
|
-
function
|
|
183
|
+
function Te({ circle: e, isMember: t, canManage: n }) {
|
|
170
184
|
let r = f(), i = A(() => [...e.channels ?? []].sort((e, t) => e.position - t.position), [e.channels]), [a, o] = j(i[0]?.id), [s, c] = j(!1), l = i.find((e) => e.id === a) ?? i[0];
|
|
171
185
|
return i.length === 0 ? /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(C, {
|
|
172
|
-
icon: /* @__PURE__ */ z(
|
|
186
|
+
icon: /* @__PURE__ */ z(P, { className: "h-10 w-10" }),
|
|
173
187
|
title: r("comradecircle.pages.circleDetail.noChannelsTitle", "No channels yet"),
|
|
174
188
|
description: n ? r("comradecircle.pages.circleDetail.noChannelsDescriptionManager", "Create the first channel to start conversations in this circle.") : r("comradecircle.pages.circleDetail.noChannelsDescriptionMember", "This circle has no channels yet. Check back soon."),
|
|
175
189
|
action: n ? /* @__PURE__ */ B(V, {
|
|
@@ -180,7 +194,7 @@ function xe({ circle: e, isMember: t, canManage: n }) {
|
|
|
180
194
|
r("comradecircle.pages.circleDetail.newChannel", "New channel")
|
|
181
195
|
]
|
|
182
196
|
}) : void 0
|
|
183
|
-
}), /* @__PURE__ */ z(
|
|
197
|
+
}), /* @__PURE__ */ z($, {
|
|
184
198
|
circleId: e.id,
|
|
185
199
|
open: s,
|
|
186
200
|
onOpenChange: c,
|
|
@@ -205,7 +219,7 @@ function xe({ circle: e, isMember: t, canManage: n }) {
|
|
|
205
219
|
}), /* @__PURE__ */ z("nav", {
|
|
206
220
|
className: "flex flex-col gap-0.5",
|
|
207
221
|
children: i.map((e) => {
|
|
208
|
-
let t =
|
|
222
|
+
let t = be[e.type], n = e.id === l?.id, r = e.type === "ANNOUNCEMENT";
|
|
209
223
|
return /* @__PURE__ */ B("button", {
|
|
210
224
|
type: "button",
|
|
211
225
|
onClick: () => o(e.id),
|
|
@@ -223,10 +237,10 @@ function xe({ circle: e, isMember: t, canManage: n }) {
|
|
|
223
237
|
className: "lg:hidden",
|
|
224
238
|
children: /* @__PURE__ */ B("div", {
|
|
225
239
|
className: "flex items-center gap-2",
|
|
226
|
-
children: [/* @__PURE__ */ B(
|
|
240
|
+
children: [/* @__PURE__ */ B(q, {
|
|
227
241
|
value: l?.id,
|
|
228
242
|
onValueChange: o,
|
|
229
|
-
children: [/* @__PURE__ */ z(
|
|
243
|
+
children: [/* @__PURE__ */ z(X, { children: /* @__PURE__ */ z(Z, { placeholder: r("comradecircle.pages.circleDetail.selectChannel", "Select a channel") }) }), /* @__PURE__ */ z(J, { children: i.map((e) => /* @__PURE__ */ B(Y, {
|
|
230
244
|
value: e.id,
|
|
231
245
|
children: ["#", e.name]
|
|
232
246
|
}, e.id)) })]
|
|
@@ -241,13 +255,13 @@ function xe({ circle: e, isMember: t, canManage: n }) {
|
|
|
241
255
|
}),
|
|
242
256
|
/* @__PURE__ */ z("div", {
|
|
243
257
|
className: "min-w-0",
|
|
244
|
-
children: l && /* @__PURE__ */ z(
|
|
258
|
+
children: l && /* @__PURE__ */ z(Ee, {
|
|
245
259
|
channel: l,
|
|
246
260
|
canPost: t,
|
|
247
261
|
canManage: n
|
|
248
262
|
})
|
|
249
263
|
}),
|
|
250
|
-
/* @__PURE__ */ z(
|
|
264
|
+
/* @__PURE__ */ z($, {
|
|
251
265
|
circleId: e.id,
|
|
252
266
|
open: s,
|
|
253
267
|
onOpenChange: c,
|
|
@@ -256,12 +270,12 @@ function xe({ circle: e, isMember: t, canManage: n }) {
|
|
|
256
270
|
]
|
|
257
271
|
});
|
|
258
272
|
}
|
|
259
|
-
function
|
|
273
|
+
function Ee({ channel: e, canPost: t, canManage: n }) {
|
|
260
274
|
let r = f(), i = d(), [a, o] = j(!1), { data: s, isLoading: u, isError: p, refetch: m } = l({
|
|
261
275
|
channelId: e.id,
|
|
262
276
|
status: "PUBLISHED",
|
|
263
277
|
pagination: {
|
|
264
|
-
limit:
|
|
278
|
+
limit: Ce,
|
|
265
279
|
cursor: i.cursor
|
|
266
280
|
}
|
|
267
281
|
});
|
|
@@ -273,7 +287,7 @@ function Se({ channel: e, canPost: t, canManage: n }) {
|
|
|
273
287
|
/* @__PURE__ */ B("div", {
|
|
274
288
|
className: "flex items-center gap-3",
|
|
275
289
|
children: [(() => {
|
|
276
|
-
let t =
|
|
290
|
+
let t = be[e.type];
|
|
277
291
|
return /* @__PURE__ */ z("span", {
|
|
278
292
|
className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-[var(--color-accent-soft)] text-accent",
|
|
279
293
|
children: /* @__PURE__ */ z(t, { className: "h-5 w-5" })
|
|
@@ -288,7 +302,7 @@ function Se({ channel: e, canPost: t, canManage: n }) {
|
|
|
288
302
|
}), g && /* @__PURE__ */ B("span", {
|
|
289
303
|
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",
|
|
290
304
|
children: [
|
|
291
|
-
/* @__PURE__ */ z(
|
|
305
|
+
/* @__PURE__ */ z(F, { className: "h-3 w-3" }),
|
|
292
306
|
" ",
|
|
293
307
|
r("comradecircle.pages.circleDetail.broadcastLabel", "Broadcast")
|
|
294
308
|
]
|
|
@@ -305,7 +319,7 @@ function Se({ channel: e, canPost: t, canManage: n }) {
|
|
|
305
319
|
onPosted: () => i.reset(),
|
|
306
320
|
onDraftSaved: () => o(!0),
|
|
307
321
|
variant: g ? "announcement" : "default"
|
|
308
|
-
}), /* @__PURE__ */ z(
|
|
322
|
+
}), /* @__PURE__ */ z(ne, {
|
|
309
323
|
channelId: e.id,
|
|
310
324
|
open: a,
|
|
311
325
|
onOpenChange: o,
|
|
@@ -313,11 +327,11 @@ function Se({ channel: e, canPost: t, canManage: n }) {
|
|
|
313
327
|
})] }),
|
|
314
328
|
g && !_ && /* @__PURE__ */ B("div", {
|
|
315
329
|
className: "rounded-xl border border-dashed border-border-seam p-6 text-center text-sm text-text-secondary",
|
|
316
|
-
children: [/* @__PURE__ */ z(
|
|
330
|
+
children: [/* @__PURE__ */ z(F, { className: "mx-auto mb-2 h-6 w-6 text-text-tertiary" }), r("comradecircle.pages.circleDetail.announcementReadOnly", "Only circle managers can post in announcement channels.")]
|
|
317
331
|
}),
|
|
318
332
|
e.type === "VOICE" && /* @__PURE__ */ B("div", {
|
|
319
333
|
className: "rounded-xl border border-dashed border-border-seam p-6 text-center text-sm text-text-secondary",
|
|
320
|
-
children: [/* @__PURE__ */ z(
|
|
334
|
+
children: [/* @__PURE__ */ z(ue, { className: "mx-auto mb-2 h-6 w-6 text-text-tertiary" }), r("comradecircle.pages.circleDetail.voiceReadOnly", "Voice channels are for live audio. Text posting is disabled here.")]
|
|
321
335
|
}),
|
|
322
336
|
u ? /* @__PURE__ */ z(T, { label: r("comradecircle.pages.circleDetail.loadingPosts", "Loading posts…") }) : p ? /* @__PURE__ */ z(w, {
|
|
323
337
|
message: r("comradecircle.pages.circleDetail.postsError", "We couldn't load posts."),
|
|
@@ -333,7 +347,7 @@ function Se({ channel: e, canPost: t, canManage: n }) {
|
|
|
333
347
|
className: "rounded-2xl border-2 border-[color:var(--color-accent)] bg-[var(--color-accent-soft)] p-1",
|
|
334
348
|
children: [/* @__PURE__ */ B("div", {
|
|
335
349
|
className: "mb-1 flex items-center gap-1.5 px-3 pt-2 text-xs font-semibold uppercase tracking-wide text-accent",
|
|
336
|
-
children: [/* @__PURE__ */ z(
|
|
350
|
+
children: [/* @__PURE__ */ z(F, { className: "h-3.5 w-3.5" }), v.isPinned ? r("comradecircle.pages.circleDetail.pinnedAnnouncement", "Pinned announcement") : r("comradecircle.pages.circleDetail.latestAnnouncement", "Latest announcement")]
|
|
337
351
|
}), /* @__PURE__ */ z(S, { post: v })]
|
|
338
352
|
}),
|
|
339
353
|
y.length > 0 && /* @__PURE__ */ B("div", {
|
|
@@ -345,7 +359,7 @@ function Se({ channel: e, canPost: t, canManage: n }) {
|
|
|
345
359
|
}),
|
|
346
360
|
/* @__PURE__ */ z(E, {
|
|
347
361
|
page: i.page,
|
|
348
|
-
pageSize:
|
|
362
|
+
pageSize: Ce,
|
|
349
363
|
itemCount: h.length,
|
|
350
364
|
hasMore: s?.pageInfo.hasMore ?? !1,
|
|
351
365
|
onPageChange: (e) => i.onPageChange(e, s?.pageInfo.cursor)
|
|
@@ -355,8 +369,8 @@ function Se({ channel: e, canPost: t, canManage: n }) {
|
|
|
355
369
|
]
|
|
356
370
|
});
|
|
357
371
|
}
|
|
358
|
-
function
|
|
359
|
-
let n = f(), r = u(), [i, a] = j(""), o = A(() => [...e.memberships ?? []].sort((e, t) =>
|
|
372
|
+
function De({ circle: e, canManage: t }) {
|
|
373
|
+
let n = f(), r = u(), [i, a] = j(""), o = A(() => [...e.memberships ?? []].sort((e, t) => Q.indexOf(e.role) - Q.indexOf(t.role)), [e.memberships]), s = A(() => {
|
|
360
374
|
let e = i.trim().toLowerCase();
|
|
361
375
|
return e ? o.filter((t) => b(t.role).toLowerCase().includes(e) || t.role.toLowerCase().includes(e) || b(t.status).toLowerCase().includes(e) || t.status.toLowerCase().includes(e)) : o;
|
|
362
376
|
}, [o, i]);
|
|
@@ -381,7 +395,7 @@ function Ce({ circle: e, canManage: t }) {
|
|
|
381
395
|
className: "flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",
|
|
382
396
|
children: [/* @__PURE__ */ B("div", {
|
|
383
397
|
className: "relative w-full sm:max-w-xs",
|
|
384
|
-
children: [/* @__PURE__ */ z(
|
|
398
|
+
children: [/* @__PURE__ */ z(de, { className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-tertiary" }), /* @__PURE__ */ z(H, {
|
|
385
399
|
value: i,
|
|
386
400
|
onChange: (e) => a(e.target.value),
|
|
387
401
|
placeholder: n("comradecircle.pages.circleDetail.filterMembersPlaceholder", "Filter by role or status…"),
|
|
@@ -420,13 +434,13 @@ function Ce({ circle: e, canManage: t }) {
|
|
|
420
434
|
children: [
|
|
421
435
|
/* @__PURE__ */ z("div", { children: /* @__PURE__ */ z(O, { status: e.status }) }),
|
|
422
436
|
/* @__PURE__ */ z("div", { children: /* @__PURE__ */ z(O, { status: e.role }) }),
|
|
423
|
-
t && /* @__PURE__ */ B(
|
|
437
|
+
t && /* @__PURE__ */ B(q, {
|
|
424
438
|
value: e.role,
|
|
425
439
|
onValueChange: (t) => c(e.id, t),
|
|
426
|
-
children: [/* @__PURE__ */ z(
|
|
440
|
+
children: [/* @__PURE__ */ z(X, {
|
|
427
441
|
className: "h-9 w-40 lg:w-full",
|
|
428
|
-
children: /* @__PURE__ */ z(
|
|
429
|
-
}), /* @__PURE__ */ z(
|
|
442
|
+
children: /* @__PURE__ */ z(Z, {})
|
|
443
|
+
}), /* @__PURE__ */ z(J, { children: Q.map((e) => /* @__PURE__ */ z(Y, {
|
|
430
444
|
value: e,
|
|
431
445
|
children: b(e)
|
|
432
446
|
}, e)) })]
|
|
@@ -437,7 +451,7 @@ function Ce({ circle: e, canManage: t }) {
|
|
|
437
451
|
})]
|
|
438
452
|
});
|
|
439
453
|
}
|
|
440
|
-
function
|
|
454
|
+
function Oe({ circle: t, isMember: n }) {
|
|
441
455
|
let r = f(), { navigateTo: a } = e(), { data: o, isLoading: s, isError: c, refetch: l } = i({ circleId: t.id }), [u, d] = j(!1), p = o?.items ?? [];
|
|
442
456
|
return /* @__PURE__ */ B("div", { children: [
|
|
443
457
|
/* @__PURE__ */ z("div", {
|
|
@@ -455,7 +469,7 @@ function we({ circle: t, isMember: n }) {
|
|
|
455
469
|
message: r("comradecircle.pages.circleDetail.eventsError", "We couldn't load events."),
|
|
456
470
|
onRetry: () => l()
|
|
457
471
|
}) : p.length === 0 ? /* @__PURE__ */ z(C, {
|
|
458
|
-
icon: /* @__PURE__ */ z(
|
|
472
|
+
icon: /* @__PURE__ */ z(N, { className: "h-9 w-9" }),
|
|
459
473
|
title: r("comradecircle.pages.circleDetail.noEventsTitle", "No events scheduled"),
|
|
460
474
|
description: n ? r("comradecircle.pages.circleDetail.noEventsDescriptionMember", "Schedule the first event for this circle.") : r("comradecircle.pages.circleDetail.noEventsDescriptionNonMember", "No upcoming events."),
|
|
461
475
|
action: n ? /* @__PURE__ */ B(V, {
|
|
@@ -468,19 +482,19 @@ function we({ circle: t, isMember: n }) {
|
|
|
468
482
|
}) : void 0
|
|
469
483
|
}) : /* @__PURE__ */ z("div", {
|
|
470
484
|
className: "grid gap-4 md:grid-cols-2",
|
|
471
|
-
children: p.map((e) => /* @__PURE__ */ z(
|
|
485
|
+
children: p.map((e) => /* @__PURE__ */ z(re, {
|
|
472
486
|
event: e,
|
|
473
487
|
onOpen: () => a(`events/${e.id}`)
|
|
474
488
|
}, e.id))
|
|
475
489
|
}),
|
|
476
|
-
/* @__PURE__ */ z(
|
|
490
|
+
/* @__PURE__ */ z(ae, {
|
|
477
491
|
circleId: t.id,
|
|
478
492
|
open: u,
|
|
479
493
|
onOpenChange: d
|
|
480
494
|
})
|
|
481
495
|
] });
|
|
482
496
|
}
|
|
483
|
-
function
|
|
497
|
+
function ke({ circle: e, isMember: t, canManage: n }) {
|
|
484
498
|
let r = f(), { data: i, isLoading: a, isError: o, refetch: c } = s(e.id), [l, u] = j(!1);
|
|
485
499
|
return /* @__PURE__ */ B("div", { children: [
|
|
486
500
|
/* @__PURE__ */ z("div", {
|
|
@@ -511,19 +525,19 @@ function Te({ circle: e, isMember: t, canManage: n }) {
|
|
|
511
525
|
}) : void 0
|
|
512
526
|
}) : /* @__PURE__ */ z("div", {
|
|
513
527
|
className: "mx-auto flex max-w-2xl flex-col gap-4",
|
|
514
|
-
children: (i ?? []).map((e) => /* @__PURE__ */ z(
|
|
528
|
+
children: (i ?? []).map((e) => /* @__PURE__ */ z(ie, {
|
|
515
529
|
poll: e,
|
|
516
530
|
canManage: n
|
|
517
531
|
}, e.id))
|
|
518
532
|
}),
|
|
519
|
-
/* @__PURE__ */ z(
|
|
533
|
+
/* @__PURE__ */ z(Me, {
|
|
520
534
|
circleId: e.id,
|
|
521
535
|
open: l,
|
|
522
536
|
onOpenChange: u
|
|
523
537
|
})
|
|
524
538
|
] });
|
|
525
539
|
}
|
|
526
|
-
function
|
|
540
|
+
function Ae({ circle: e }) {
|
|
527
541
|
let t = f();
|
|
528
542
|
return /* @__PURE__ */ z("div", {
|
|
529
543
|
className: "mx-auto max-w-2xl",
|
|
@@ -582,21 +596,21 @@ function Ee({ circle: e }) {
|
|
|
582
596
|
})
|
|
583
597
|
});
|
|
584
598
|
}
|
|
585
|
-
var
|
|
599
|
+
var je = [
|
|
586
600
|
"TEXT",
|
|
587
601
|
"FORUM",
|
|
588
602
|
"ANNOUNCEMENT",
|
|
589
603
|
"VOICE"
|
|
590
604
|
];
|
|
591
|
-
function
|
|
605
|
+
function $({ circleId: e, open: t, onOpenChange: r, onCreated: i }) {
|
|
592
606
|
let a = f(), o = n(), [s, c] = j(""), [l, u] = j(""), [d, p] = j("TEXT"), [m, h] = j(null);
|
|
593
|
-
return /* @__PURE__ */ z(
|
|
607
|
+
return /* @__PURE__ */ z(W, {
|
|
594
608
|
open: t,
|
|
595
609
|
onOpenChange: r,
|
|
596
|
-
children: /* @__PURE__ */ B(
|
|
610
|
+
children: /* @__PURE__ */ B(G, {
|
|
597
611
|
className: "sm:max-w-md",
|
|
598
612
|
children: [
|
|
599
|
-
/* @__PURE__ */ B(
|
|
613
|
+
/* @__PURE__ */ B(ge, { children: [/* @__PURE__ */ z(_e, { children: a("comradecircle.pages.circleDetail.createChannelTitle", "Create a channel") }), /* @__PURE__ */ z(K, { children: a("comradecircle.pages.circleDetail.createChannelDescription", "Channels organise conversations by topic or format.") })] }),
|
|
600
614
|
/* @__PURE__ */ B("div", {
|
|
601
615
|
className: "flex flex-col gap-4 py-2",
|
|
602
616
|
children: [
|
|
@@ -614,10 +628,10 @@ function Oe({ circleId: e, open: t, onOpenChange: r, onCreated: i }) {
|
|
|
614
628
|
}),
|
|
615
629
|
/* @__PURE__ */ B("div", {
|
|
616
630
|
className: "grid gap-1.5",
|
|
617
|
-
children: [/* @__PURE__ */ z(U, { children: a("comradecircle.pages.circleDetail.channelTypeLabel", "Type") }), /* @__PURE__ */ B(
|
|
631
|
+
children: [/* @__PURE__ */ z(U, { children: a("comradecircle.pages.circleDetail.channelTypeLabel", "Type") }), /* @__PURE__ */ B(q, {
|
|
618
632
|
value: d,
|
|
619
633
|
onValueChange: (e) => p(e),
|
|
620
|
-
children: [/* @__PURE__ */ z(
|
|
634
|
+
children: [/* @__PURE__ */ z(X, { children: /* @__PURE__ */ z(Z, {}) }), /* @__PURE__ */ z(J, { children: je.map((e) => /* @__PURE__ */ z(Y, {
|
|
621
635
|
value: e,
|
|
622
636
|
children: b(e)
|
|
623
637
|
}, e)) })]
|
|
@@ -628,7 +642,7 @@ function Oe({ circleId: e, open: t, onOpenChange: r, onCreated: i }) {
|
|
|
628
642
|
children: [/* @__PURE__ */ z(U, {
|
|
629
643
|
htmlFor: "channel-desc",
|
|
630
644
|
children: a("comradecircle.pages.circleDetail.channelDescriptionLabel", "Description")
|
|
631
|
-
}), /* @__PURE__ */ z(
|
|
645
|
+
}), /* @__PURE__ */ z(ye, {
|
|
632
646
|
id: "channel-desc",
|
|
633
647
|
value: l,
|
|
634
648
|
onChange: (e) => u(e.target.value),
|
|
@@ -641,7 +655,7 @@ function Oe({ circleId: e, open: t, onOpenChange: r, onCreated: i }) {
|
|
|
641
655
|
})
|
|
642
656
|
]
|
|
643
657
|
}),
|
|
644
|
-
/* @__PURE__ */ B(
|
|
658
|
+
/* @__PURE__ */ B(he, { children: [/* @__PURE__ */ z(V, {
|
|
645
659
|
variant: "outline",
|
|
646
660
|
onClick: () => r(!1),
|
|
647
661
|
children: a("common.cancel", "Cancel")
|
|
@@ -671,20 +685,20 @@ function Oe({ circleId: e, open: t, onOpenChange: r, onCreated: i }) {
|
|
|
671
685
|
})
|
|
672
686
|
});
|
|
673
687
|
}
|
|
674
|
-
function
|
|
688
|
+
function Me({ circleId: e, open: t, onOpenChange: n }) {
|
|
675
689
|
let i = f(), a = r(), [o, s] = j(""), [c, l] = j(["", ""]), [u, d] = j(!1), [p, m] = j(!1), [h, g] = j(""), [y, b] = j(null), x = A(() => {
|
|
676
690
|
let e = /* @__PURE__ */ new Date();
|
|
677
691
|
return e.setMinutes(e.getMinutes() - e.getTimezoneOffset()), e.toISOString().slice(0, 16);
|
|
678
692
|
}, []), S = () => {
|
|
679
693
|
s(""), l(["", ""]), d(!1), m(!1), g(""), b(null);
|
|
680
694
|
};
|
|
681
|
-
return /* @__PURE__ */ z(
|
|
695
|
+
return /* @__PURE__ */ z(W, {
|
|
682
696
|
open: t,
|
|
683
697
|
onOpenChange: n,
|
|
684
|
-
children: /* @__PURE__ */ B(
|
|
698
|
+
children: /* @__PURE__ */ B(G, {
|
|
685
699
|
className: "sm:max-w-md",
|
|
686
700
|
children: [
|
|
687
|
-
/* @__PURE__ */ B(
|
|
701
|
+
/* @__PURE__ */ B(ge, { children: [/* @__PURE__ */ z(_e, { children: i("comradecircle.pages.circleDetail.createPollTitle", "Create a poll") }), /* @__PURE__ */ z(K, { children: i("comradecircle.pages.circleDetail.createPollDescription", "Gather the circle's opinion.") })] }),
|
|
688
702
|
/* @__PURE__ */ B("div", {
|
|
689
703
|
className: "flex flex-col gap-4 py-2",
|
|
690
704
|
children: [
|
|
@@ -762,7 +776,7 @@ function ke({ circleId: e, open: t, onOpenChange: n }) {
|
|
|
762
776
|
className: "text-xs text-text-tertiary",
|
|
763
777
|
children: i("comradecircle.pages.circleDetail.pollMultiHint", "Let voters pick more than one option.")
|
|
764
778
|
})]
|
|
765
|
-
}), /* @__PURE__ */ z(
|
|
779
|
+
}), /* @__PURE__ */ z(ve, {
|
|
766
780
|
id: "poll-multi",
|
|
767
781
|
checked: u,
|
|
768
782
|
onCheckedChange: d
|
|
@@ -778,7 +792,7 @@ function ke({ circleId: e, open: t, onOpenChange: n }) {
|
|
|
778
792
|
className: "text-xs text-text-tertiary",
|
|
779
793
|
children: i("comradecircle.pages.circleDetail.pollAnonymousHint", "Hide who voted for each option.")
|
|
780
794
|
})]
|
|
781
|
-
}), /* @__PURE__ */ z(
|
|
795
|
+
}), /* @__PURE__ */ z(ve, {
|
|
782
796
|
id: "poll-anon",
|
|
783
797
|
checked: p,
|
|
784
798
|
onCheckedChange: m
|
|
@@ -791,7 +805,7 @@ function ke({ circleId: e, open: t, onOpenChange: n }) {
|
|
|
791
805
|
})
|
|
792
806
|
]
|
|
793
807
|
}),
|
|
794
|
-
/* @__PURE__ */ B(
|
|
808
|
+
/* @__PURE__ */ B(he, { children: [/* @__PURE__ */ z(V, {
|
|
795
809
|
variant: "outline",
|
|
796
810
|
onClick: () => n(!1),
|
|
797
811
|
children: i("common.cancel", "Cancel")
|
|
@@ -827,6 +841,6 @@ function ke({ circleId: e, open: t, onOpenChange: n }) {
|
|
|
827
841
|
});
|
|
828
842
|
}
|
|
829
843
|
//#endregion
|
|
830
|
-
export {
|
|
844
|
+
export { we as CircleDetailPage };
|
|
831
845
|
|
|
832
846
|
//# sourceMappingURL=CircleDetailPage.js.map
|