import * as Tooltip from '@radix-ui/react-tooltip'; import { useMutation, useQueryClient } from '@tanstack/react-query'; import { createBlock } from '@libs/storage'; import { ThreadIcon } from '@shared/icons'; import { NoteReaction } from '@shared/notes/actions/reaction'; import { NoteReply } from '@shared/notes/actions/reply'; import { NoteRepost } from '@shared/notes/actions/repost'; import { NoteZap } from '@shared/notes/actions/zap'; export function NoteActions({ id, pubkey }: { id: string; pubkey: string }) { const queryClient = useQueryClient(); const block = useMutation({ mutationFn: (data: { kind: number; title: string; content: string }) => { return createBlock(data.kind, data.title, data.content); }, onSuccess: () => { queryClient.invalidateQueries({ queryKey: ['blocks'] }); }, }); const openThread = (thread: string) => { block.mutate({ kind: 2, title: 'Thread', content: thread }); }; return (
Open thread
); }