import { Link } from 'react-router-dom'; import { useMemo } from 'react'; import { ShieldAlert, ArrowRight, Activity } from 'lucide-react'; import { useCurrentUser } from '@/hooks/useCurrentUser'; import { useSkateSpots } from '@/hooks/useSkateSpots'; import { isAdminPubkey } from '@/lib/admins'; import { isFlagged } from '@/lib/spotQuality'; import { useTranslation } from '@/contexts/language'; /** * Admin-only entry point for the review queue. Renders nothing for everyone * else, so it can sit in Settings → Advanced beside the other owner cards. */ export function AdminReviewCard() { const { user } = useCurrentUser(); const isAdmin = isAdminPubkey(user?.pubkey); const { data: spots } = useSkateSpots(300); const { t } = useTranslation(); // Cheap signals only here (no per-spot trust/status queries just to draw a // badge) — the review page does the deeper pass. const flaggedCount = useMemo(() => (spots ?? []).filter(isFlagged).length, [spots]); if (!isAdmin) return null; return (
{t('settingsUi.adminReview.title')}
{flaggedCount > 0 ? t('settingsUi.adminReview.flagged', { count: flaggedCount, s: flaggedCount === 1 ? '' : 's' }) : t('settingsUi.adminReview.clean')}
Operator status
Read-only relay, Cordn, storage and TLS health.