import * as React from "react" import { Card } from "@/components/ui/card" import { Badge } from "@/components/ui/badge" import { Button } from "@/components/ui/button" import { Calendar, Clock, User, MapPin, MoreVertical } from "lucide-react" import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu" import { cn } from "@/lib/utils" interface StaffInfo { name: string role?: string } interface BookingCardProps { id: string customerName: string serviceName: string startTime: string endTime: string status: 'confirmed' | 'pending' | 'completed' | 'no_show' | 'cancelled' staff: StaffInfo location?: string onReschedule?: () => void onCancel?: () => void onMarkNoShow?: () => void onViewDetails?: () => void className?: string } const statusColors: Record = { confirmed: { bg: 'var(--forest-green-alpha)', text: 'var(--forest-green)' }, pending: { bg: 'var(--clay-orange-alpha)', text: 'var(--clay-orange)' }, completed: { bg: 'var(--slate-blue-alpha)', text: 'var(--slate-blue)' }, no_show: { bg: 'var(--brick-red-alpha)', text: 'var(--brick-red)' }, cancelled: { bg: 'var(--charcoal-brown-alpha)', text: 'var(--charcoal-brown)' }, } /** * BookingCard component for displaying booking information in the dashboard. * @param {string} id - Unique booking identifier * @param {string} customerName - Name of the customer * @param {string} serviceName - Name of the service booked * @param {string} startTime - Start time of the booking * @param {string} endTime - End time of the booking * @param {string} status - Booking status * @param {Object} staff - Staff information with name and optional role * @param {string} location - Optional location name * @param {Function} onReschedule - Callback for rescheduling * @param {Function} onCancel - Callback for cancellation * @param {Function} onMarkNoShow - Callback for marking as no-show * @param {Function} onViewDetails - Callback for viewing details * @param {string} className - Optional additional CSS classes */ export function BookingCard({ id, customerName, serviceName, startTime, endTime, status, staff, location, onReschedule, onCancel, onMarkNoShow, onViewDetails, className }: BookingCardProps) { const statusColor = statusColors[status] const canReschedule = ['confirmed', 'pending'].includes(status) const canCancel = ['confirmed', 'pending'].includes(status) const canMarkNoShow = status === 'confirmed' return (

{serviceName}

{customerName}
{new Date(startTime).toLocaleDateString()}
{new Date(startTime).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })} -{' '} {new Date(endTime).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })}
{onViewDetails && ( Ver Detalles )} {canReschedule && onReschedule && ( Reprogramar )} {canMarkNoShow && onMarkNoShow && ( Marcar como No-Show )} {canCancel && onCancel && ( Cancelar )}
{status.replace('_', ' ').toUpperCase()} {location && (
{location}
)}
{staff.name} {staff.role && ( ({staff.role}) )}
) }