"use client" import { Check, Calendar } from "lucide-react" import { Badge } from "@/components/ui/badge" import { Button } from "@/components/ui/button" import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card" import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs" type Service = { id: string name: string description: string duration: number price: number category: string isActive: boolean } type ServicesDisplayProps = { services: Service[] onSelectService?: (serviceId: string) => void scrollToBooking?: boolean } export function ServicesDisplay({ services, onSelectService, scrollToBooking = true }: ServicesDisplayProps) { const handleServiceSelect = (serviceId: string) => { if (onSelectService) { onSelectService(serviceId) } if (scrollToBooking) { // Scroll to booking form setTimeout(() => { const bookingSection = document.getElementById('booking-form-section') if (bookingSection) { bookingSection.scrollIntoView({ behavior: 'smooth', block: 'start' }) } }, 100) } } // Group services by category const servicesByCategory = services.reduce((acc, service) => { if (!acc[service.category]) { acc[service.category] = [] } acc[service.category].push(service) return acc }, {} as Record) const categories = Object.keys(servicesByCategory) const defaultCategory = categories[0] || "" // Map category names to badges const categoryBadges: Record = { "Preventive Care": "Essential", "Restorative": "Popular", "Cosmetic": "Premium", "Orthodontics": "Advanced", "Emergency": "Urgent", } return (
{categories.map((category) => ( {category} ))} {categories.map((category) => (
{category} {categoryBadges[category] || "Service"}
Professional dental services with transparent pricing
{servicesByCategory[category].map((service, index) => (

{service.name}

{service.description}

⏱️ {service.duration} mins
₱{service.price.toLocaleString()} {onSelectService && ( )}
))}
))}
) }