import { useState } from 'react'; import { Flag, AlertTriangle } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, } from '@/components/ui/dialog'; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from '@/components/ui/select'; import { Textarea } from '@/components/ui/textarea'; import { Label } from '@/components/ui/label'; import { useAuth } from '@/hooks/useAuth'; import { useReportMutation } from '@/hooks/reports/useReportMutation'; interface ReportButtonProps { entityType: 'review' | 'profile' | 'content_submission'; entityId: string; className?: string; } const REPORT_TYPES = [ { value: 'spam', label: 'Spam' }, { value: 'inappropriate', label: 'Inappropriate Content' }, { value: 'harassment', label: 'Harassment' }, { value: 'fake_info', label: 'Fake Information' }, { value: 'offensive', label: 'Offensive Language' }, ]; export function ReportButton({ entityType, entityId, className }: ReportButtonProps) { const [open, setOpen] = useState(false); const [reportType, setReportType] = useState(''); const [reason, setReason] = useState(''); const { user } = useAuth(); const reportMutation = useReportMutation(); const handleSubmit = () => { if (!user || !reportType) return; reportMutation.mutate( { entityType, entityId, reportType, reason }, { onSuccess: () => { setOpen(false); setReportType(''); setReason(''); }, } ); }; if (!user) return null; return ( Report Content Help us maintain a safe community by reporting inappropriate content.