fix and update language for company workspace
This commit is contained in:
@@ -50,7 +50,9 @@ interface BookingOptions {
|
||||
|
||||
interface Step1 {
|
||||
startDate: string
|
||||
startTime: string
|
||||
endDate: string
|
||||
endTime: string
|
||||
}
|
||||
|
||||
interface Step2 {
|
||||
@@ -192,7 +194,7 @@ export default function BookClient({ language }: { language: PublicSiteLanguage
|
||||
const [bookingOptions, setBookingOptions] = useState<BookingOptions | null>(null)
|
||||
const [bookingOptionsError, setBookingOptionsError] = useState('')
|
||||
|
||||
const [step1, setStep1] = useState<Step1>({ startDate: '', endDate: '' })
|
||||
const [step1, setStep1] = useState<Step1>({ startDate: '', startTime: '10:00', endDate: '', endTime: '10:00' })
|
||||
const [step1Errors, setStep1Errors] = useState<Partial<Step1>>({})
|
||||
const [step2, setStep2] = useState<Step2>({
|
||||
firstName: '',
|
||||
@@ -643,8 +645,13 @@ export default function BookClient({ language }: { language: PublicSiteLanguage
|
||||
|
||||
{step === 3 && (
|
||||
<div className="space-y-6">
|
||||
{vehicle && (
|
||||
<div className="rounded-xl border border-sky-200 bg-sky-50 px-4 py-3 text-sm text-sky-800">
|
||||
{dict.booking.categoryNotice(dict.vehicles.categoryLabels[vehicle.category as keyof typeof dict.vehicles.categoryLabels] ?? vehicle.category)}
|
||||
</div>
|
||||
)}
|
||||
<div className="overflow-hidden rounded-xl border border-slate-200 divide-y divide-slate-100 text-sm">
|
||||
<SummaryRow label={dict.booking.summary.vehicle} value={vehicle ? `${vehicle.make} ${vehicle.model}` : vehicleId} />
|
||||
<SummaryRow label={dict.booking.summary.vehicle} value={vehicle ? `${dict.vehicles.categoryLabels[vehicle.category as keyof typeof dict.vehicles.categoryLabels] ?? vehicle.category} — ${vehicle.make} ${vehicle.model}` : vehicleId} />
|
||||
<SummaryRow label={dict.booking.summary.dates} value={`${step1.startDate} -> ${step1.endDate} (${days} ${dayLabel})`} />
|
||||
<SummaryRow label={dict.booking.summary.primaryDriver} value={`${step2.firstName} ${step2.lastName}`} />
|
||||
<SummaryRow label={dict.booking.summary.email} value={step2.email} />
|
||||
|
||||
@@ -12,6 +12,7 @@ interface ReservationDetail {
|
||||
endDate: string
|
||||
totalDays: number
|
||||
totalAmount: number
|
||||
vehicleCategory: string | null
|
||||
vehicle: { make: string; model: string; year: number } | null
|
||||
customer: { firstName: string; lastName: string; email: string } | null
|
||||
}
|
||||
@@ -69,8 +70,8 @@ export default async function BookingConfirmationPage({ searchParams = {} }: Pag
|
||||
<div className="bg-slate-50 px-4 py-2.5 text-xs font-semibold uppercase tracking-[0.12em] text-slate-500">
|
||||
{dict.confirmation.bookingSummary}
|
||||
</div>
|
||||
{reservation.vehicle && (
|
||||
<Row label={dict.confirmation.vehicle} value={`${reservation.vehicle.make} ${reservation.vehicle.model} (${reservation.vehicle.year})`} />
|
||||
{reservation.vehicleCategory && (
|
||||
<Row label={dict.confirmation.vehicleCategory} value={dict.vehicles.categoryLabels[reservation.vehicleCategory as keyof typeof dict.vehicles.categoryLabels] ?? reservation.vehicleCategory} />
|
||||
)}
|
||||
{reservation.customer && (
|
||||
<Row label={dict.confirmation.customer} value={`${reservation.customer.firstName} ${reservation.customer.lastName}`} />
|
||||
|
||||
@@ -111,6 +111,16 @@ export type PublicSiteDictionary = {
|
||||
seats: (count: number) => string
|
||||
perDay: string
|
||||
viewDetails: string
|
||||
categoryLabels: {
|
||||
ECONOMY: string
|
||||
COMPACT: string
|
||||
MIDSIZE: string
|
||||
FULLSIZE: string
|
||||
SUV: string
|
||||
LUXURY: string
|
||||
VAN: string
|
||||
TRUCK: string
|
||||
}
|
||||
filters: {
|
||||
title: string
|
||||
clearAll: string
|
||||
@@ -150,7 +160,9 @@ export type PublicSiteDictionary = {
|
||||
vehicleUnavailableNoDate: string
|
||||
bookingOptionsLoadError: string
|
||||
startDate: string
|
||||
startTime: string
|
||||
endDate: string
|
||||
endTime: string
|
||||
continueToDriverDetails: string
|
||||
firstName: string
|
||||
lastName: string
|
||||
@@ -189,6 +201,7 @@ export type PublicSiteDictionary = {
|
||||
redirectingToPayment: string
|
||||
confirmPayAtPickup: string
|
||||
payWith: (provider: string) => string
|
||||
categoryNotice: (category: string) => string
|
||||
summary: {
|
||||
vehicle: string
|
||||
dates: string
|
||||
@@ -235,6 +248,7 @@ export type PublicSiteDictionary = {
|
||||
description: string
|
||||
bookingSummary: string
|
||||
vehicle: string
|
||||
vehicleCategory: string
|
||||
customer: string
|
||||
email: string
|
||||
dates: string
|
||||
@@ -364,6 +378,16 @@ const dictionaries: Record<PublicSiteLanguage, PublicSiteDictionary> = {
|
||||
seats: (count) => `${count} seats`,
|
||||
perDay: 'per day',
|
||||
viewDetails: 'View details',
|
||||
categoryLabels: {
|
||||
ECONOMY: 'Economy',
|
||||
COMPACT: 'Compact',
|
||||
MIDSIZE: 'Midsize',
|
||||
FULLSIZE: 'Full-size',
|
||||
SUV: 'SUV',
|
||||
LUXURY: 'Luxury',
|
||||
VAN: 'Van',
|
||||
TRUCK: 'Truck',
|
||||
},
|
||||
filters: {
|
||||
title: 'Filters',
|
||||
clearAll: 'Clear all',
|
||||
@@ -402,8 +426,10 @@ const dictionaries: Record<PublicSiteLanguage, PublicSiteDictionary> = {
|
||||
vehicleAvailableFrom: (date) => `This vehicle can only be reserved starting ${date}.`,
|
||||
vehicleUnavailableNoDate: 'This vehicle is temporarily unavailable for new reservations.',
|
||||
bookingOptionsLoadError: 'Could not load booking options.',
|
||||
startDate: 'Start date',
|
||||
endDate: 'End date',
|
||||
startDate: 'Pick-up date',
|
||||
startTime: 'Pick-up time',
|
||||
endDate: 'Drop-off date',
|
||||
endTime: 'Drop-off time',
|
||||
continueToDriverDetails: 'Continue to driver details ->',
|
||||
firstName: 'First name',
|
||||
lastName: 'Last name',
|
||||
@@ -442,6 +468,7 @@ const dictionaries: Record<PublicSiteLanguage, PublicSiteDictionary> = {
|
||||
redirectingToPayment: 'Redirecting to payment...',
|
||||
confirmPayAtPickup: 'Confirm - pay at pickup',
|
||||
payWith: (provider) => `Pay with ${provider} ->`,
|
||||
categoryNotice: (category) => `Your vehicle will be assigned from the ${category} category upon arrival. The specific car may differ from the one shown.`,
|
||||
summary: {
|
||||
vehicle: 'Vehicle',
|
||||
dates: 'Dates',
|
||||
@@ -488,6 +515,7 @@ const dictionaries: Record<PublicSiteLanguage, PublicSiteDictionary> = {
|
||||
description: 'The reservation has been created in draft status and will be confirmed by staff or after payment.',
|
||||
bookingSummary: 'Booking summary',
|
||||
vehicle: 'Vehicle',
|
||||
vehicleCategory: 'Vehicle category',
|
||||
customer: 'Customer',
|
||||
email: 'Email',
|
||||
dates: 'Dates',
|
||||
@@ -615,6 +643,16 @@ const dictionaries: Record<PublicSiteLanguage, PublicSiteDictionary> = {
|
||||
seats: (count) => `${count} places`,
|
||||
perDay: 'par jour',
|
||||
viewDetails: 'Voir les détails',
|
||||
categoryLabels: {
|
||||
ECONOMY: 'Économique',
|
||||
COMPACT: 'Compacte',
|
||||
MIDSIZE: 'Intermédiaire',
|
||||
FULLSIZE: 'Grande berline',
|
||||
SUV: 'SUV',
|
||||
LUXURY: 'Luxe',
|
||||
VAN: 'Van',
|
||||
TRUCK: 'Camionnette',
|
||||
},
|
||||
filters: {
|
||||
title: 'Filtres',
|
||||
clearAll: 'Tout effacer',
|
||||
@@ -653,8 +691,10 @@ const dictionaries: Record<PublicSiteLanguage, PublicSiteDictionary> = {
|
||||
vehicleAvailableFrom: (date) => `Ce véhicule ne peut être réservé qu’à partir du ${date}.`,
|
||||
vehicleUnavailableNoDate: 'Ce véhicule est temporairement indisponible pour les nouvelles réservations.',
|
||||
bookingOptionsLoadError: 'Impossible de charger les options de réservation.',
|
||||
startDate: 'Date de début',
|
||||
endDate: 'Date de fin',
|
||||
startDate: 'Date de prise en charge',
|
||||
startTime: 'Heure de prise en charge',
|
||||
endDate: 'Date de restitution',
|
||||
endTime: 'Heure de restitution',
|
||||
continueToDriverDetails: 'Continuer vers les informations conducteur ->',
|
||||
firstName: 'Prénom',
|
||||
lastName: 'Nom',
|
||||
@@ -693,6 +733,7 @@ const dictionaries: Record<PublicSiteLanguage, PublicSiteDictionary> = {
|
||||
redirectingToPayment: 'Redirection vers le paiement...',
|
||||
confirmPayAtPickup: 'Confirmer - payer au retrait',
|
||||
payWith: (provider) => `Payer avec ${provider} ->`,
|
||||
categoryNotice: (category) => `Votre véhicule sera attribué depuis la catégorie ${category} à la prise en charge. Le véhicule exact peut différer de celui affiché.`,
|
||||
summary: {
|
||||
vehicle: 'Véhicule',
|
||||
dates: 'Dates',
|
||||
@@ -739,6 +780,7 @@ const dictionaries: Record<PublicSiteLanguage, PublicSiteDictionary> = {
|
||||
description: 'La réservation a été créée en brouillon et sera confirmée par le personnel ou après paiement.',
|
||||
bookingSummary: 'Résumé de réservation',
|
||||
vehicle: 'Véhicule',
|
||||
vehicleCategory: 'Catégorie du véhicule',
|
||||
customer: 'Client',
|
||||
email: 'E-mail',
|
||||
dates: 'Dates',
|
||||
@@ -866,6 +908,16 @@ const dictionaries: Record<PublicSiteLanguage, PublicSiteDictionary> = {
|
||||
seats: (count) => `${count} مقاعد`,
|
||||
perDay: 'في اليوم',
|
||||
viewDetails: 'عرض التفاصيل',
|
||||
categoryLabels: {
|
||||
ECONOMY: 'اقتصادية',
|
||||
COMPACT: 'مدمجة',
|
||||
MIDSIZE: 'متوسطة',
|
||||
FULLSIZE: 'كبيرة',
|
||||
SUV: 'دفع رباعي',
|
||||
LUXURY: 'فاخرة',
|
||||
VAN: 'فان',
|
||||
TRUCK: 'شاحنة',
|
||||
},
|
||||
filters: {
|
||||
title: 'الفلاتر',
|
||||
clearAll: 'مسح الكل',
|
||||
@@ -904,8 +956,10 @@ const dictionaries: Record<PublicSiteLanguage, PublicSiteDictionary> = {
|
||||
vehicleAvailableFrom: (date) => `يمكن حجز هذه المركبة ابتداءً من ${date}.`,
|
||||
vehicleUnavailableNoDate: 'هذه المركبة غير متاحة مؤقتاً للحجوزات الجديدة.',
|
||||
bookingOptionsLoadError: 'تعذر تحميل خيارات الحجز.',
|
||||
startDate: 'تاريخ البداية',
|
||||
endDate: 'تاريخ النهاية',
|
||||
startDate: 'تاريخ الاستلام',
|
||||
startTime: 'وقت الاستلام',
|
||||
endDate: 'تاريخ الإرجاع',
|
||||
endTime: 'وقت الإرجاع',
|
||||
continueToDriverDetails: 'المتابعة إلى بيانات السائق ->',
|
||||
firstName: 'الاسم الأول',
|
||||
lastName: 'اسم العائلة',
|
||||
@@ -944,6 +998,7 @@ const dictionaries: Record<PublicSiteLanguage, PublicSiteDictionary> = {
|
||||
redirectingToPayment: 'جارٍ التحويل إلى الدفع...',
|
||||
confirmPayAtPickup: 'تأكيد - الدفع عند الاستلام',
|
||||
payWith: (provider) => `ادفع عبر ${provider} ->`,
|
||||
categoryNotice: (category) => `سيتم تخصيص مركبتك من فئة ${category} عند الاستلام. قد تختلف السيارة المحددة عن تلك المعروضة.`,
|
||||
summary: {
|
||||
vehicle: 'المركبة',
|
||||
dates: 'التواريخ',
|
||||
@@ -990,6 +1045,7 @@ const dictionaries: Record<PublicSiteLanguage, PublicSiteDictionary> = {
|
||||
description: 'تم إنشاء الحجز بحالة مسودة وسيتم تأكيده من قبل الموظفين أو بعد الدفع.',
|
||||
bookingSummary: 'ملخص الحجز',
|
||||
vehicle: 'المركبة',
|
||||
vehicleCategory: 'فئة المركبة',
|
||||
customer: 'العميل',
|
||||
email: 'البريد الإلكتروني',
|
||||
dates: 'التواريخ',
|
||||
|
||||
Reference in New Issue
Block a user