import { Outlet } from "react-router-dom"; import { useIsFetching } from "@tanstack/react-query"; import { Sidebar } from "./Sidebar"; export function Layout() { // useIsFetching() returns the number of in-flight queries and is 0 on // first load (queries that have not yet fired are not counted). We use it // to drive a 1px hairline scan element at the very top of the layout. const isFetching = useIsFetching(); const showScan = isFetching > 0; return (
{/* Scan element — always in the DOM (no layout shift), 1px tall, full width. pointer-events-none so it never blocks clicks. The inner bar uses the `scan` keyframe from tailwind.config to slide a 1/3- width electric-blue bar across the hairline. */}
); }