import React from "react";
import { useLocation } from "react-router-dom";
import QuickAccess from "./QuickAccess";
import { useAuth } from "@/lib/auth-context";

const QuickAccessWrapper: React.FC = () => {
  const location = useLocation();
  const { isAuthenticated } = useAuth();
  
  // Routes where QuickAccess should be hidden
  const hiddenRoutes = [
    "/", // Landing page
    "/login",
    "/register",
    "/forgot-password",
    "/reset-password",
    "/download-app"
  ];
  
  // Check if current path is in the hidden routes list
  const shouldHide = hiddenRoutes.includes(location.pathname);
  
  // Only render QuickAccess if authenticated and not on a hidden route
  if (!isAuthenticated || shouldHide) {
    return null;
  }
  
  return <QuickAccess />;
};

export default QuickAccessWrapper; 