View no shows in booking panel
This commit is contained in:
@@ -112,7 +112,9 @@ function makeTimelineHours(range: BookingTimeRange) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function isActiveBooking(booking: AdminBooking) {
|
function isActiveBooking(booking: AdminBooking) {
|
||||||
return booking.status === 'CONFIRMED' || booking.status === 'COMPLETED';
|
return (
|
||||||
|
booking.status === 'CONFIRMED' || booking.status === 'COMPLETED' || booking.status === 'NOSHOW'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getCourtBookings(court: Court, bookings: AdminBooking[], selectedDate: string) {
|
function getCourtBookings(court: Court, bookings: AdminBooking[], selectedDate: string) {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
import { cn } from '@/lib/utils';
|
import { cn } from '@/lib/utils';
|
||||||
import { ChevronLeft, ChevronRight, Dumbbell, Plus, Users } from 'lucide-react';
|
import { ChevronLeft, ChevronRight, Dumbbell, Plus, UserX, Users } from 'lucide-react';
|
||||||
import { useBooking } from '../booking-provider';
|
import { useBooking } from '../booking-provider';
|
||||||
import type { BookingCourtSchedule, BookingTimelineSegment } from '../booking.types';
|
import type { BookingCourtSchedule, BookingTimelineSegment } from '../booking.types';
|
||||||
import { timeToMinutes } from '../lib/booking-time';
|
import { timeToMinutes } from '../lib/booking-time';
|
||||||
@@ -227,7 +227,9 @@ function BookingSlotBlock({ segment, schedule, rangeStart, totalMinutes }: Booki
|
|||||||
segment.status === 'maintenance' &&
|
segment.status === 'maintenance' &&
|
||||||
'border-maintenance/80 bg-maintenance/75 text-maintenance-foreground',
|
'border-maintenance/80 bg-maintenance/75 text-maintenance-foreground',
|
||||||
segment.booking?.status === 'COMPLETED' &&
|
segment.booking?.status === 'COMPLETED' &&
|
||||||
'border-reserved/70 bg-reserved/25 dark:text-reserved-foreground text-gray-600 line-through'
|
'border-reserved/70 bg-reserved/25 dark:text-reserved-foreground text-gray-600 line-through',
|
||||||
|
segment.booking?.status === 'NOSHOW' &&
|
||||||
|
'border-amber-500/60 bg-amber-500/50 text-amber-950 dark:text-amber-200'
|
||||||
)}
|
)}
|
||||||
style={{
|
style={{
|
||||||
left: `calc(${left}% + 4px)`,
|
left: `calc(${left}% + 4px)`,
|
||||||
@@ -240,6 +242,8 @@ function BookingSlotBlock({ segment, schedule, rangeStart, totalMinutes }: Booki
|
|||||||
startTime: segment.startTime,
|
startTime: segment.startTime,
|
||||||
sportId: schedule.court.sportId,
|
sportId: schedule.court.sportId,
|
||||||
});
|
});
|
||||||
|
} else if (segment.booking?.status === 'NOSHOW') {
|
||||||
|
return;
|
||||||
} else {
|
} else {
|
||||||
if (event.shiftKey && segment.booking?.status === 'CONFIRMED') {
|
if (event.shiftKey && segment.booking?.status === 'CONFIRMED') {
|
||||||
updateBookingStatus(segment.booking.id, 'COMPLETED');
|
updateBookingStatus(segment.booking.id, 'COMPLETED');
|
||||||
@@ -261,9 +265,16 @@ function BookingSlotBlock({ segment, schedule, rangeStart, totalMinutes }: Booki
|
|||||||
</span>
|
</span>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<span className="truncate text-sm font-medium">
|
<div className="flex items-center justify-between">
|
||||||
{segment.startTime} - {segment.endTime}
|
<span className="truncate text-sm font-medium">
|
||||||
</span>
|
{segment.startTime} - {segment.endTime}
|
||||||
|
</span>
|
||||||
|
{segment.booking?.status === 'NOSHOW' && (
|
||||||
|
<span title="No Show - El cliente no se presentó">
|
||||||
|
<UserX className="size-3 shrink-0" />
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
<span className="mt-1 flex items-center gap-1 truncate opacity-90">
|
<span className="mt-1 flex items-center gap-1 truncate opacity-90">
|
||||||
<Users className="size-3" />
|
<Users className="size-3" />
|
||||||
{segment.booking?.customerName ?? 'Mantenimiento'}
|
{segment.booking?.customerName ?? 'Mantenimiento'}
|
||||||
|
|||||||
Reference in New Issue
Block a user