'use client'; import * as Icons from './Icons'; /** * The one spinner and the one error-with-retry for admin screens (#609), so a * failed load looks the same everywhere and always offers a way out. * * Renders nothing once there is data and no error; the caller renders the * content then. */ export default function AdminLoadState({ loading, error, onRetry, hasData, }: { loading: boolean; error: string | null; onRetry: () => void; /** With data already on screen, a reload shows no spinner over it. */ hasData?: boolean; }) { if (error) { return (

{error}

); } if (loading && !hasData) { return (
); } return null; }