'use client';

import { useState } from 'react';
import CalendrierTrajets from './CalendrierTrajets';
import ListeTrajets from './ListeTrajets';

export default function CalendrierPageContent() {
  const [refreshTrigger, setRefreshTrigger] = useState(0);

  const handleTrajetCreated = () => {
    setRefreshTrigger((prev) => prev + 1);
  };

  return (
    <div className="grid grid-cols-1 lg:grid-cols-3 gap-4 sm:gap-6 lg:gap-8">
      {/* Calendrier - Prend 2 colonnes sur grand écran */}
      <div className="lg:col-span-2">
        <CalendrierTrajets refreshTrigger={refreshTrigger} />
      </div>

      {/* Liste des derniers trajets - Prend 1 colonne sur grand écran */}
      <div className="lg:col-span-1">
        <ListeTrajets onTrajetCreated={handleTrajetCreated} />
      </div>
    </div>
  );
}
