/**
 * Global catch-all (splat) route.
 *
 * Modern.js/react-router resolves any URL that doesn't match a more
 * specific route here. The loader throws a 404 Response so SSR emits
 * the correct HTTP status code (TZ §4.1.21). The errorElement (error.tsx)
 * then renders the branded "Страница не найдена" page with URL preserved.
 */

export const loader = (): never => {
  throw new Response(null, { status: 404 });
};

// The page component is unreachable (loader always throws), but Modern.js
// requires a default export for file-based route modules.
export default function NotFoundRoute(): null {
  return null;
}
