feat(stats): put the region backfill right on the stats page

The admin backfill lived only in Settings -> Advanced, so an admin staring at
the 'Uncategorised' row had no obvious way to fix it. Render the admin-only
RegionBackfillCard inline in the region section when uncategorised > 0, and
clarify the zero-state (remaining untagged pins belong to other mappers).
This commit is contained in:
SkateSpots 2026-10-01 14:07:14 +07:00
parent dc0ae9bc32
commit 02b81a8b76
2 changed files with 6 additions and 1 deletions

View file

@ -80,7 +80,8 @@ export function RegionBackfillCard() {
<p className="text-xs text-muted-foreground">Scanning your spots…</p> <p className="text-xs text-muted-foreground">Scanning your spots…</p>
) : count === 0 ? ( ) : count === 0 ? (
<p className="text-xs text-[#ccff00]"> <p className="text-xs text-[#ccff00]">
Every spot &amp; shop you own already has a region tag. 🎉 Every spot &amp; shop you own already has a region tag. 🎉 Any remaining
“Uncategorised” pins belong to other mappers — only their own keys can tag them.
</p> </p>
) : ( ) : (
<> <>

View file

@ -7,6 +7,7 @@ import { useAuthor } from '@/hooks/useAuthor';
import { genUserName } from '@/lib/genUserName'; import { genUserName } from '@/lib/genUserName';
import { Avatar, AvatarImage, AvatarFallback } from '@/components/ui/avatar'; import { Avatar, AvatarImage, AvatarFallback } from '@/components/ui/avatar';
import { useGrowthStats } from '@/hooks/useGrowthStats'; import { useGrowthStats } from '@/hooks/useGrowthStats';
import { RegionBackfillCard } from '@/components/RegionBackfillCard';
import { cn } from '@/lib/utils'; import { cn } from '@/lib/utils';
import { formatAge } from '@/lib/routeCache'; import { formatAge } from '@/lib/routeCache';
@ -449,6 +450,9 @@ export default function CommunityStatsPage() {
<> <strong className="text-gray-500">{uncategorised} of {locationsTotal}</strong> location{locationsTotal === 1 ? '' : 's'} have no location tag and show as “Uncategorised”.</> <> <strong className="text-gray-500">{uncategorised} of {locationsTotal}</strong> location{locationsTotal === 1 ? '' : 's'} have no location tag and show as “Uncategorised”.</>
)} )}
</p> </p>
{/* Admin-only (renders null otherwise): fix the gap right where it
shows up — re-derive region tags for the viewer's own legacy pins. */}
{uncategorised > 0 && <div className="mt-4"><RegionBackfillCard /></div>}
</section> </section>
)} )}