import { useLocation } from "react-router-dom";
import { AuthSkeleton } from "./AuthSkeleton";
import { PageSkeleton } from "./PageSkeleton";

export function LoadingFallback() {
  const location = useLocation();
  const path = location.pathname;

  if (path === "/login" || path === "/register") {
    return <AuthSkeleton />;
  }
  
  // For Kill Generation (DeathMsg) or other HUD tools
  if (path.startsWith("/hud") || path.startsWith("/demo")) {
    return <PageSkeleton />;
  }

  // Default fallback (Home, About, etc.)
  return <PageSkeleton />;
}
