import React from 'react';
import { useLocation } from 'react-router-dom';
import Footer from '@/components/common/Footer';
import Header from '@/components/common/Header';

interface MainLayoutProps {
  children: React.ReactNode;
}

const MainLayout: React.FC<MainLayoutProps> = ({ children }) => {
  const location = useLocation();
  const isPlanner = location.pathname.startsWith('/planner');
  const isCreateTrip = location.pathname.startsWith('/create-trip');

  // Hide header/footer on planner or special pages if needed
  const hideHeader = false; 
  const hideFooter = isPlanner || isCreateTrip;

  return (
    <div className="flex min-h-screen w-full flex-col bg-background">
      {!hideHeader && <Header />}
      <main className="flex-1">
        {children}
      </main>
      {!hideFooter && <Footer />}
    </div>
  );
};

export default MainLayout;
