chore: clean up

This commit is contained in:
reya
2024-08-28 08:48:17 +07:00
parent f6eb5eea44
commit d128af1db8
27 changed files with 311 additions and 741 deletions

View File

@@ -1,9 +1,8 @@
import { commands } from "@/commands.gen";
import { decodeZapInvoice, formatCreatedAt } from "@/commons";
import { Spinner } from "@/components";
import { Note } from "@/components/note";
import { User } from "@/components/user";
import { type LumeEvent, NostrQuery, useEvent } from "@/system";
import { Kind } from "@/types";
import { Note, Spinner, User } from "@/components";
import { LumeEvent, useEvent } from "@/system";
import { Kind, type NostrEvent } from "@/types";
import { Info, Repeat } from "@phosphor-icons/react";
import * as ScrollArea from "@radix-ui/react-scroll-area";
import * as Tabs from "@radix-ui/react-tabs";
@@ -24,7 +23,15 @@ function Screen() {
const { isLoading, data } = useQuery({
queryKey: ["notification", account],
queryFn: async () => {
const events = await NostrQuery.getNotifications();
const res = await commands.getNotifications();
if (res.status === "error") {
throw new Error(res.error);
}
const data: NostrEvent[] = res.data.map((item) => JSON.parse(item));
const events = data.map((ev) => new LumeEvent(ev));
return events;
},
select: (events) => {