mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 08:48:11 +00:00
38 lines
997 B
TypeScript
38 lines
997 B
TypeScript
'use client';
|
|
|
|
import { usePathname } from 'next/navigation';
|
|
import { ProgressIndicator } from '@/components/ProgressIndicator';
|
|
|
|
export default function BookingLayout({
|
|
children,
|
|
}: {
|
|
children: React.ReactNode;
|
|
}) {
|
|
const pathname = usePathname();
|
|
|
|
const stepMap: Record<string, string> = {
|
|
'/booking/search': 'search',
|
|
'/booking/results': 'results',
|
|
'/booking/auth-check': 'passengers',
|
|
'/booking/passengers': 'passengers',
|
|
'/booking/seats': 'seats',
|
|
'/booking/review': 'review',
|
|
'/booking/payment': 'payment',
|
|
'/booking/confirmation': 'confirmation',
|
|
};
|
|
|
|
const currentStep = stepMap[pathname] || 'search';
|
|
const showProgress = pathname !== '/booking/search' && pathname !== '/booking/confirmation';
|
|
|
|
return (
|
|
<div>
|
|
{showProgress && (
|
|
<div className="bg-white dark:bg-gray-800 border-b dark:border-gray-700">
|
|
<ProgressIndicator currentStep={currentStep} />
|
|
</div>
|
|
)}
|
|
{children}
|
|
</div>
|
|
);
|
|
}
|