Finish the audit leftovers

- One mediaUrl in media.ts instead of 12 identical aliases and a
  kind map; orgPath builds on hrefs.ts's orgHref
- One Logo component (hides itself or shows a fallback when the file
  is missing) for event cards, org lists and chapter marks
- useHistory is a thin wrapper over useRecord
- adminSchema.ts split into adminSchema/, one file per entity plus
  shared.ts; the registry is unchanged (checked by loading both)
- JS smooth scrolls respect reduced motion (lib/motion.ts)
- Content-Security-Policy in Report-Only, with /api/csp-report logging
  what it would block

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Zaldimmar 2026-09-28 22:49:07 -05:00
parent c74ad746f5
commit e4a9c96f7e
42 changed files with 1968 additions and 2043 deletions

27
src/components/Logo.tsx Normal file
View file

@ -0,0 +1,27 @@
/* ═══════════════════════════════════════════════════════════════
LOGO
An <img> for a logo or mark that may not exist: no src, or a file
that 404s, and it draws `fallback` instead (initials, a colour dot,
or nothing). `src` is already resolved (mediaUrl in media.ts).
Decorative by default (alt ""), since a logo sits next to the
name it stands for.
═══════════════════════════════════════════════════════════════ */
import { useState, type ReactNode } from 'react'
export default function Logo({
src,
alt = '',
className,
fallback = null,
}: {
src?: string | null
alt?: string
className?: string
fallback?: ReactNode
}) {
const [failed, setFailed] = useState(false)
if (!src || failed) return <>{fallback}</>
return <img src={src} alt={alt} loading="lazy" className={className} onError={() => setFailed(true)} />
}