flotilla/src/app/actionItems.ts

13 lines
452 B
TypeScript
Raw Normal View History

2026-07-28 16:16:26 +00:00
import {derived} from "svelte/store"
2026-08-17 16:21:30 +00:00
import {REPORT, sortEventsDesc} from "@welshman/util"
import {rooms} from "@app/core"
import {deriveEventsForUrl} from "@app/repository"
2026-07-28 16:16:26 +00:00
// Action items (admin review queue)
export const deriveSpaceActionItems = (url: string) =>
derived(
2026-08-17 16:21:30 +00:00
[deriveEventsForUrl(url, [{kinds: [REPORT]}]), rooms.get().pendingJoins(url).$],
([$reports, $pendingJoins]) => sortEventsDesc([...$reports, ...$pendingJoins]),
)