import { Link } from 'react-router-dom'; import { useMemo } from 'react'; import { ShieldAlert, ArrowRight } from 'lucide-react'; import { useCurrentUser } from '@/hooks/useCurrentUser'; import { useSkateSpots } from '@/hooks/useSkateSpots'; import { isAdminPubkey } from '@/lib/admins'; import { isFlagged } from '@/lib/spotQuality'; /** * 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); // 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 (
Review queue
{flaggedCount > 0 ? `${flaggedCount} spot${flaggedCount === 1 ? '' : 's'} trip the junk signals — hide or dismiss.` : 'Spots that look like test entries or off-topic pins.'}