import ReportCard from '@/components/ReportCard' import { RefreshButton } from '@/components/RefreshButton' import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from '@/components/ui/dialog' import { Skeleton } from '@/components/ui/skeleton' import { useProfileReportsEvents } from '@/hooks/useProfileReportsEvents' import { useProfileReportsRelayBuilder } from '@/hooks/useProfileReportsRelayBuilder' import { RefreshCw } from 'lucide-react' import { useEffect, useState } from 'react' import { useTranslation } from 'react-i18next' export function ProfileReportsPanel({ pubkey }: { pubkey: string }) { const { t } = useTranslation() const relayUrlsBuilder = useProfileReportsRelayBuilder(pubkey) const { received, made, isLoading, refresh } = useProfileReportsEvents({ pubkey, relayUrlsBuilder }) const [isRefreshing, setIsRefreshing] = useState(false) useEffect(() => { if (!isLoading) setIsRefreshing(false) }, [isLoading]) const handleRefresh = () => { setIsRefreshing(true) refresh() } if (isLoading && received.length === 0 && made.length === 0) { return (
{t('No reports received')}
) : ({t('No reports made')}
) : (