refactor(booking): remove maintenance-related metrics and UI components
This commit is contained in:
@@ -31,7 +31,6 @@ import {
|
||||
Sun,
|
||||
User,
|
||||
Users,
|
||||
Wrench,
|
||||
} from 'lucide-react';
|
||||
import type React from 'react';
|
||||
import { useMemo, useState } from 'react';
|
||||
@@ -400,11 +399,6 @@ function MobileSummary() {
|
||||
label="Reservados"
|
||||
className="bg-reserved/15 text-reserved"
|
||||
/>
|
||||
<SummaryPill
|
||||
value={summary.maintenanceSlots}
|
||||
label="Mantenim."
|
||||
className="bg-maintenance/15 text-maintenance"
|
||||
/>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
@@ -426,7 +420,6 @@ function MobileStatusTab() {
|
||||
{ value: 'all', label: 'Todos' },
|
||||
{ value: 'free', label: 'Libres' },
|
||||
{ value: 'reserved', label: 'Reservados' },
|
||||
{ value: 'maintenance', label: 'Mantenimiento' },
|
||||
] as const;
|
||||
const timeRangeOptions = [
|
||||
{ label: '08:00 - 22:00', start: '08:00', end: '22:00' },
|
||||
@@ -850,14 +843,10 @@ function MobileSegmentRow({
|
||||
) : (
|
||||
<div className="max-w-[132px] text-right">
|
||||
<p className="truncate text-sm font-medium">
|
||||
{segment.booking?.customerName ?? 'Mantenimiento'}
|
||||
{segment.booking?.customerName ?? 'Sin información'}
|
||||
</p>
|
||||
<p className="mt-2 inline-flex items-center gap-1 text-sm text-muted-foreground">
|
||||
{segment.status === 'maintenance' ? (
|
||||
<Wrench className="size-4" />
|
||||
) : (
|
||||
<Users className="size-4" />
|
||||
)}
|
||||
<Users className="size-4" />
|
||||
{segment.booking?.customerPhone ?? 'Personal'}
|
||||
</p>
|
||||
</div>
|
||||
@@ -868,23 +857,21 @@ function MobileSegmentRow({
|
||||
|
||||
function SegmentStatusLine({ segment }: { segment: BookingTimelineSegment }) {
|
||||
const status = segment.status;
|
||||
const label = status === 'free' ? 'Libre' : status === 'reserved' ? 'Reservado' : 'Mantenimiento';
|
||||
const label = status === 'free' ? 'Libre' : 'Reservado';
|
||||
|
||||
return (
|
||||
<p
|
||||
className={cn(
|
||||
'mt-2 inline-flex items-center gap-2 text-sm',
|
||||
status === 'free' && 'text-primary',
|
||||
status === 'reserved' && 'text-reserved',
|
||||
status === 'maintenance' && 'text-maintenance'
|
||||
status === 'reserved' && 'text-reserved'
|
||||
)}
|
||||
>
|
||||
<span
|
||||
className={cn(
|
||||
'size-3 rounded-full',
|
||||
status === 'free' && 'bg-primary',
|
||||
status === 'reserved' && 'bg-reserved',
|
||||
status === 'maintenance' && 'bg-maintenance'
|
||||
status === 'reserved' && 'bg-reserved'
|
||||
)}
|
||||
/>
|
||||
{label}
|
||||
@@ -897,7 +884,6 @@ function StatusLegend() {
|
||||
<div className="flex items-center justify-between gap-3 text-sm">
|
||||
<LegendItem label="Libre" className="bg-primary" />
|
||||
<LegendItem label="Reservado" className="bg-reserved" />
|
||||
<LegendItem label="Mantenimiento" className="bg-maintenance" />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -929,9 +915,7 @@ function MiniSlot({
|
||||
className={cn(
|
||||
'min-w-0 rounded-lg border px-1.5 py-2 text-center transition active:scale-[0.98] disabled:opacity-60',
|
||||
segment.status === 'free' && 'border-primary/50 bg-primary/15 text-primary',
|
||||
segment.status === 'reserved' && 'border-reserved/50 bg-reserved/15 text-reserved',
|
||||
segment.status === 'maintenance' &&
|
||||
'border-maintenance/50 bg-maintenance/15 text-maintenance'
|
||||
segment.status === 'reserved' && 'border-reserved/50 bg-reserved/15 text-reserved'
|
||||
)}
|
||||
disabled={!isActionable}
|
||||
onClick={() => {
|
||||
@@ -981,10 +965,6 @@ function MetricDots({ schedule }: { schedule: BookingCourtSchedule }) {
|
||||
<span className="size-3 rounded-full bg-reserved" />
|
||||
{schedule.metrics.reserved}
|
||||
</span>
|
||||
<span className="inline-flex items-center gap-1 text-maintenance">
|
||||
<span className="size-3 rounded-full bg-maintenance" />
|
||||
{schedule.metrics.maintenance}
|
||||
</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user