import { toRelay } from '@/lib/link' import { useSecondaryPage } from '@/PageManager' import { useFavoriteRelays } from '@/providers/FavoriteRelaysProvider' import { X } from 'lucide-react' import { useState } from 'react' import RelayIcon from '../RelayIcon' import { Button } from '../ui/button' import { Skeleton } from '../ui/skeleton' import logger from '@/lib/logger' export default function BlockedRelayItem({ relay }: { relay: string }) { const { push } = useSecondaryPage() const { deleteBlockedRelays } = useFavoriteRelays() const [isLoading, setIsLoading] = useState(false) const handleUnblock = async (e: React.MouseEvent) => { e.stopPropagation() if (isLoading) return setIsLoading(true) try { await deleteBlockedRelays([relay]) } catch (error) { logger.error('Failed to unblock relay', { error, relay }) } finally { setIsLoading(false) } } return (