'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="flex flex-col gap-6 sm:gap-8">
      {/* Calendrier en haut */}
      <div>
        <CalendrierTrajets refreshTrigger={refreshTrigger} />
      </div>

      {/* Liste des trajets en bas, triable par période */}
      <div>
        <ListeTrajets onTrajetCreated={handleTrajetCreated} />
      </div>
    </div>
  );
}
