MCPcopy Create free account
hub / github.com/adrianhajdin/threads / DeleteThread

Function DeleteThread

components/forms/DeleteThread.tsx:16–43  ·  view source on GitHub ↗
({
  threadId,
  currentUserId,
  authorId,
  parentId,
  isComment,
}: Props)

Source from the content-addressed store, hash-verified

14}
15
16function DeleteThread({
17 threadId,
18 currentUserId,
19 authorId,
20 parentId,
21 isComment,
22}: Props) {
23 const pathname = usePathname();
24 const router = useRouter();
25
26 if (currentUserId !== authorId || pathname === "/") return null;
27
28 return (
29 <Image
30 src='/assets/delete.svg'
31 alt='delte'
32 width={18}
33 height={18}
34 className='cursor-pointer object-contain'
35 onClick={async () => {
36 await deleteThread(JSON.parse(threadId), pathname);
37 if (!parentId || !isComment) {
38 router.push("/");
39 }
40 }}
41 />
42 );
43}
44
45export default DeleteThread;

Callers

nothing calls this directly

Calls 1

deleteThreadFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…