feat: add reporting

This commit is contained in:
Xyphyn committed 2023-07-26 19:13:26 -07:00
1 parent ff2d424a99
commit 6fcef02809
14 files changed
+206 -33

No files matched your search

@@ -0,0 +1,26 @@
import type { CommentView, PostView } from 'lemmy-js-client'
import { writable } from 'svelte/store'
interface Modals {
reporting: {
open: boolean
item: PostView | CommentView | undefined
}
}
export let modals = writable<Modals>({
reporting: {
open: true,
item: undefined,
},
})
export function report(item: PostView | CommentView) {
modals.update((m) => ({
...m,
reporting: {
open: true,
item: item,
},
}))
}