import { Outlet } from 'react-router-dom';
import { StorageKeys } from '@/shared/constants/local-storage';
import { getLocalStorage } from '@/shared/lib';
import { useSubLayoutContext } from '@/widgets/sub-layout/use-sub-layout';

export const ProtectedRoute = () => {
  const subLayoutContext = useSubLayoutContext();

  const token =  getLocalStorage(StorageKeys.AccessToken);
  // return token ? <Outlet context={{ ...subLayoutContext }} /> : <Navigate to={PATHS.start} replace />;
  return (
    <Outlet context={{ ...subLayoutContext }} />
  );
};
