Live wall: pinned/docked cameras stop when their provider is switched off; admin-only empty-state CTA
- LiveView: localStorage pins carry image URLs, so they rendered (without credit) after an admin disabled the provider. Pins now show only while their provider is serving (server-26#198 licence gating). - MapView: pinned/docked map players drop out once their provider leaves the serving list; credits are kept from the last answer so docked players keep attribution while the overlay is hidden. - WallPanels: the "no camera provider enabled" link to /admin was a dead CTA for non-admins (bounced to /). Link shown to admins only, deep-linked to /admin#cameras; the admin page now honours a tab hash. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
af00139079
commit
e6b1581139
@@ -10,6 +10,7 @@ import type {
|
||||
AircraftTrack, CallRecord, Camera, CameraCredit, CameraProviderFeed, IncidentRecord, Ny511Event, NodeRecord, VesselTrack,
|
||||
} from "@/lib/types";
|
||||
import { isKnownSeverity, SEVERITY_COLORS, SEVERITY_LABEL } from "@/lib/severity";
|
||||
import { useAuth } from "@/components/AuthProvider";
|
||||
import { CameraFeed } from "@/components/CameraFeed";
|
||||
import { MachineOutputNotice } from "@/components/ui/MachineOutputNotice";
|
||||
import { SourceCredit, fetchedLabel } from "@/components/SourceCredit";
|
||||
@@ -43,11 +44,15 @@ export function CameraTile({ cam, feed, km, onOpen }: { cam: Camera; feed?: Came
|
||||
}
|
||||
|
||||
function NoCameras({ servingCount, radiusKm }: { servingCount: number; radiusKm: number }) {
|
||||
// Only admins can open /admin (everyone else is bounced to /), so only they get the link.
|
||||
const { isAdmin } = useAuth();
|
||||
return (
|
||||
<p className="text-xs text-ink-muted">
|
||||
{servingCount === 0
|
||||
? <>No camera provider is enabled. An admin turns them on under <Link href="/admin" className="underline">Admin → Camera providers</Link>.</>
|
||||
: `No public camera within ${radiusKm} km.`}
|
||||
{servingCount !== 0
|
||||
? `No public camera within ${radiusKm} km.`
|
||||
: isAdmin
|
||||
? <>No camera provider is enabled. Turn one on under <Link href="/admin#cameras" className="underline">Admin → Camera providers</Link>.</>
|
||||
: "No camera provider is enabled. A platform admin can turn them on."}
|
||||
</p>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user