'use client' import { useCallback } from 'react' import { useModeration } from '@/hooks/useModeration' import { muteThread, unmuteThread } from '@/utils/moderation' interface MuteThreadButtonProps { postId: string className?: string } /** * Toggles a thread mute for a post. Muted threads are hidden from the feed by * Feed.tsx (via utils/moderation). State is shared through useModeration so the * label stays in sync everywhere. */ export default function MuteThreadButton({ postId, className = '' }: MuteThreadButtonProps) { const moderation = useModeration() const isMuted = moderation.mutedThreads.includes(postId) const handleToggle = useCallback(() => { if (isMuted) { unmuteThread(postId) } else { muteThread(postId) } }, [isMuted, postId]) return ( ) }