// components/vendors/SidebarCards.tsx import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card' import { Button } from '@/components/ui/button' import Link from 'next/link' interface SidebarCardsProps { description?: string | null events?: Array<{ id: string name: string date: Date | null }> timeline: { createdAt: Date bookedDate?: Date | null depositDueDate?: Date | null finalPaymentDue?: Date | null } vendorId: string } const formatDate = (date?: Date | null): string => { if (!date) return '—' return new Date(date).toLocaleDateString('en-US', { year: 'numeric', month: 'long', day: 'numeric', }) } export function SidebarCards({ description, events, timeline, vendorId }: SidebarCardsProps) { return (
{/* Description */} {description && ( Description

{description}

)} {/* Associated Events */} {events && events.length > 0 && ( Associated Events {events.length} event{events.length !== 1 ? 's' : ''}
{events.map((event) => (

{event.name}

{event.date && (

{formatDate(event.date)}

)}
))}
)} {/* Status Timeline */} Status Timeline
Created {formatDate(timeline.createdAt)}
{timeline.bookedDate && (
Booked {formatDate(timeline.bookedDate)}
)} {timeline.depositDueDate && (
Deposit Due {formatDate(timeline.depositDueDate)}
)} {timeline.finalPaymentDue && (
Final Payment Due {formatDate(timeline.finalPaymentDue)}
)}
{/* Quick Actions */} Quick Actions
) }