import React from "react";
import {Outlet} from "react-router-dom";
import {QueryClient} from '@tanstack/react-query';

export const queryClient = new QueryClient({
  defaultOptions: {
    queries: {
      staleTime: 5 * 60 * 1000,      // 5 min: data considered fresh
      refetchOnWindowFocus: true,   // refresh on tab switch
      refetchOnReconnect: true,     // re-fetch if network was lost
      retry: false,   
    },
  },
});

const AuthLayout = () => {
  return (
    <div className="login-box">
      <Outlet />
    </div>
  );
};

export default AuthLayout;
