@burdenoff/microfe-kadaikodi 2026.1124.1 → 2026.1126.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/kadaikodi/components/AppointmentSettingsSection.d.ts +13 -0
- package/dist/kadaikodi/components/AppointmentSettingsSection.js +206 -0
- package/dist/kadaikodi/components/AppointmentSettingsSection.js.map +1 -0
- package/dist/kadaikodi/components/AppointmentSlotPicker.d.ts +19 -0
- package/dist/kadaikodi/components/AppointmentSlotPicker.js +106 -0
- package/dist/kadaikodi/components/AppointmentSlotPicker.js.map +1 -0
- package/dist/kadaikodi/components/ProviderAppointmentQueue.d.ts +15 -0
- package/dist/kadaikodi/components/ProviderAppointmentQueue.js +179 -0
- package/dist/kadaikodi/components/ProviderAppointmentQueue.js.map +1 -0
- package/dist/kadaikodi/hooks/useAppointmentsApi.d.ts +122 -0
- package/dist/kadaikodi/hooks/useAppointmentsApi.js +186 -0
- package/dist/kadaikodi/hooks/useAppointmentsApi.js.map +1 -0
- package/dist/kadaikodi/hooks/useKadaikodiApi.d.ts +3 -0
- package/dist/kadaikodi/hooks/useKadaikodiApi.js +5 -4
- package/dist/kadaikodi/hooks/useKadaikodiApi.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/CartOwnerDashboard.js +97 -94
- package/dist/kadaikodi/pages/cart-owner/CartOwnerDashboard.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/CartServiceConfigPage.js +172 -170
- package/dist/kadaikodi/pages/cart-owner/CartServiceConfigPage.js.map +1 -1
- package/dist/kadaikodi/pages/cart-owner/OrderManagementPage.js +250 -241
- package/dist/kadaikodi/pages/cart-owner/OrderManagementPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/BookingDetailsPage.d.ts +3 -1
- package/dist/kadaikodi/pages/customer/BookingDetailsPage.js +317 -178
- package/dist/kadaikodi/pages/customer/BookingDetailsPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/DirectServiceBookingPage.d.ts +3 -3
- package/dist/kadaikodi/pages/customer/DirectServiceBookingPage.js +307 -338
- package/dist/kadaikodi/pages/customer/DirectServiceBookingPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BookingDetailsPage.js","names":["SUPPORT_EMAIL","BookingDetailsPage","useParams","useKadaikodi","order","useOrder","bookingId","createReview","useCreateReview","cancelOrder","useUpdateOrderStatus","statusMessage","setStatusMessage","useState","showRateModal","setShowRateModal","rating","setRating","reviewText","setReviewText","showStatus","msg","timeline","useMemo","isLoading","PageLayout","EmptyState","CalendarCheck","navigateTo","isCancelled","isCompleted","canCancel","addr","hasAddress","alreadyRated","ArrowLeft","StatusBadge","PagePurpose","CheckCircle2","GlassCard","formatDate","item","formatCurrency","index","ShoppingBag","Timeline","event","Headphones","cn","Star","MapPin","Loader2","XCircle","X","star","currentUser"],"sources":["../../../../src/kadaikodi/pages/customer/BookingDetailsPage.tsx"],"sourcesContent":["/**\n * Booking Details Page\n * @module kadaikodi/pages/customer\n *\n * Detailed view of a service booking with service name, provider info,\n * scheduled date/time, booking status timeline, location info,\n * price breakdown, Contact Support button, Rate Service button (when completed),\n * Cart Information sidebar, cancel button.\n * Uses route param :bookingId from useParams().\n */\n\nimport { useMemo, useState } from 'react';\nimport { useParams } from 'react-router';\nimport {\n ArrowLeft,\n MapPin,\n Star,\n CheckCircle2,\n XCircle,\n ShoppingBag,\n CalendarCheck,\n Headphones,\n Loader2,\n X,\n} from 'lucide-react';\nimport { GlassCard, PagePurpose } from '@burdenoff/fe-libs/ui';\nimport { PageLayout } from '../../components/PageLayout';\nimport { StatusBadge } from '../../components/StatusBadge';\nimport { EmptyState } from '../../components/EmptyState';\nimport { Timeline, type TimelineItem } from '../../components/viz';\nimport { useKadaikodi } from '../../context/KadaikodiContext';\nimport { useOrder, useCreateReview, useUpdateOrderStatus } from '../../hooks/useKadaikodiApi';\nimport { cn } from '../../utils/cn';\nimport { formatCurrency, formatDate } from '../../utils/formatters';\n\nconst SUPPORT_EMAIL = 'support@kadaikodi.com';\n\n// ============================================================================\n// Types\n// ============================================================================\n\ninterface BookingTimelineEvent {\n status: string;\n label: string;\n timestamp: string | null;\n completed: boolean;\n}\n\n// ============================================================================\n// Component\n// ============================================================================\n\nexport function BookingDetailsPage() {\n const { bookingId } = useParams<{ bookingId: string }>();\n const { navigateTo, currentUser } = useKadaikodi();\n const { data: order, isLoading } = useOrder(bookingId);\n const createReview = useCreateReview();\n const cancelOrder = useUpdateOrderStatus();\n const [statusMessage, setStatusMessage] = useState<string | null>(null);\n const [showRateModal, setShowRateModal] = useState(false);\n const [rating, setRating] = useState(5);\n const [reviewText, setReviewText] = useState('');\n\n const showStatus = (msg: string) => {\n setStatusMessage(msg);\n setTimeout(() => setStatusMessage(null), 3000);\n };\n\n // Build the timeline from the order's real recorded events; fall back to a\n // single \"order placed\" milestone derived from the order date.\n const timeline = useMemo<BookingTimelineEvent[]>(() => {\n if (!order) return [];\n if (order.timeline.length > 0) {\n return order.timeline.map((e) => ({\n status: e.status,\n label: e.description || e.status,\n timestamp: e.timestamp,\n completed: true,\n }));\n }\n return [\n { status: 'placed', label: 'Order placed', timestamp: order.orderDate, completed: true },\n ];\n }, [order]);\n\n if (isLoading) {\n return (\n <PageLayout title=\"Booking Details\">\n <div className=\"flex items-center justify-center py-20\">\n <div className=\"h-12 w-12 animate-spin rounded-full border-b-2 border-foreground\" />\n </div>\n </PageLayout>\n );\n }\n\n if (!order) {\n return (\n <PageLayout title=\"Booking Not Found\">\n <EmptyState\n icon={<CalendarCheck className=\"h-12 w-12\" />}\n title=\"Booking not found\"\n description={`No booking found with ID \"${bookingId}\".`}\n action={\n <button\n type=\"button\"\n onClick={() => navigateTo('/customer/dashboard')}\n className=\"rounded-lg bg-foreground px-4 py-2 text-sm font-medium text-background hover:opacity-90 transition-opacity\"\n >\n Go to Dashboard\n </button>\n }\n />\n </PageLayout>\n );\n }\n\n const isCancelled = order.status === 'cancelled';\n const isCompleted = order.status === 'delivered';\n const canCancel = !isCancelled && !isCompleted;\n const addr = order.deliveryAddress;\n const hasAddress = Boolean(addr.street || addr.area || addr.city);\n\n const alreadyRated = order.rating != null && order.rating > 0;\n\n const handleSubmitRating = () => {\n if (!currentUser?.id) {\n showStatus('Please sign in to rate this service.');\n return;\n }\n createReview.mutate(\n {\n providerId: order.cartId,\n orderId: order.id,\n customerId: currentUser.id,\n rating,\n review: reviewText.trim() || undefined,\n },\n {\n onSuccess: () => {\n setShowRateModal(false);\n setReviewText('');\n showStatus('Thanks! Your rating has been submitted.');\n },\n onError: () => showStatus('Could not submit your rating. Please try again.'),\n }\n );\n };\n\n const handleCancelBooking = () => {\n if (!window.confirm('Cancel this booking? This cannot be undone.')) return;\n cancelOrder.mutate(\n { id: order.id, status: 'CANCELLED' },\n {\n onSuccess: () => showStatus('Your booking has been cancelled.'),\n onError: () => showStatus('Could not cancel the booking. Please try again.'),\n }\n );\n };\n\n return (\n <PageLayout\n title={\n <div className=\"flex items-center gap-3\">\n <button\n type=\"button\"\n onClick={() => navigateTo('/customer/dashboard')}\n className=\"rounded-md p-1 text-text-secondary hover:bg-accent hover:text-text-primary transition-colors\"\n >\n <ArrowLeft className=\"h-5 w-5\" />\n </button>\n <span>Booking #{order.id}</span>\n </div>\n }\n actions={<StatusBadge status={order.status} />}\n >\n <PagePurpose className=\"mb-4\">\n The full picture of one service booking — who's providing it, what was ordered, what it\n costs, and the actions you can take such as contacting support or cancelling.\n </PagePurpose>\n\n {/* Status message */}\n {statusMessage && (\n <div className=\"mb-4 rounded-lg border border-status-success-text/30 bg-status-success-bg-subtle p-3 flex items-center gap-2\">\n <CheckCircle2 className=\"h-4 w-4 text-status-success-text shrink-0\" />\n <p className=\"text-sm text-status-success-text\">{statusMessage}</p>\n </div>\n )}\n\n <div className=\"grid grid-cols-1 gap-6 lg:grid-cols-3\">\n {/* Left: Main Content */}\n <div className=\"lg:col-span-2 space-y-6\">\n {/* Service Info — the one emphasis zone */}\n <GlassCard treatment=\"glass\" glow className=\"p-6\">\n <h2 className=\"text-lg font-semibold text-text-primary\">{order.cartName}</h2>\n <p className=\"mt-1 text-sm text-text-secondary\">\n Order placed on {formatDate(order.orderDate)}\n </p>\n\n {order.items.length > 0 && (\n <div className=\"mt-4 space-y-1.5\">\n {order.items.map((item, index) => (\n <div key={item.id || index} className=\"flex justify-between text-sm\">\n <span className=\"text-text-primary\">\n {item.quantity}x {item.name}\n </span>\n <span className=\"text-text-secondary\">\n {formatCurrency(item.price * item.quantity, { minimumFractionDigits: 0 })}\n </span>\n </div>\n ))}\n </div>\n )}\n </GlassCard>\n\n {/* Provider Info */}\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-6\">\n <h2 className=\"text-base font-semibold text-text-primary mb-4\">Service Provider</h2>\n <div className=\"flex items-center gap-4\">\n <div className=\"flex h-12 w-12 items-center justify-center rounded-full bg-bg-sunken text-text-secondary\">\n <ShoppingBag className=\"h-6 w-6\" />\n </div>\n <div className=\"flex-1 min-w-0\">\n <p className=\"text-sm font-semibold text-text-primary\">{order.cartName}</p>\n </div>\n <button\n type=\"button\"\n onClick={() => navigateTo(`/customer/cart/${order.cartId}`)}\n className=\"rounded-lg border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary hover:bg-accent transition-colors\"\n >\n View Cart\n </button>\n </div>\n </div>\n\n {/* Booking Status Timeline */}\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-6\">\n <h2 className=\"text-base font-semibold text-text-primary mb-5\">Booking Timeline</h2>\n <Timeline\n items={timeline.map((event, index): TimelineItem => ({\n id: `${event.status}-${index}`,\n title: event.label,\n tone:\n event.status === 'cancelled' ? 'danger' : event.completed ? 'success' : 'muted',\n time: event.timestamp ? formatDate(event.timestamp) : 'Pending',\n }))}\n />\n </div>\n\n {/* Action Buttons: Contact Support + Rate Service */}\n <div className=\"flex flex-col sm:flex-row gap-3\">\n <a\n href={`mailto:${SUPPORT_EMAIL}?subject=${encodeURIComponent(\n `Support request — Booking #${order.id}`\n )}`}\n className=\"flex-1 flex items-center justify-center gap-2 rounded-lg border border-border-subtle px-4 py-3 text-sm font-medium text-text-primary hover:bg-accent transition-colors\"\n >\n <Headphones className=\"h-4 w-4\" />\n Contact Support\n </a>\n\n {isCompleted && (\n <button\n type=\"button\"\n disabled={alreadyRated}\n onClick={() => setShowRateModal(true)}\n className={cn(\n 'flex-1 flex items-center justify-center gap-2 rounded-lg px-4 py-3 text-sm font-medium transition-opacity',\n alreadyRated\n ? 'bg-bg-sunken text-text-secondary cursor-not-allowed'\n : 'bg-foreground text-background hover:opacity-90'\n )}\n >\n <Star className=\"h-4 w-4\" />\n {alreadyRated ? 'Rated' : 'Rate Service'}\n </button>\n )}\n </div>\n </div>\n\n {/* Right: Sidebar */}\n <div className=\"space-y-6\">\n {/* Cart Information */}\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-5\">\n <h3 className=\"text-base font-semibold text-text-primary mb-3\">Cart Information</h3>\n <div className=\"flex items-center gap-3 mb-4\">\n <div className=\"flex h-14 w-14 shrink-0 items-center justify-center rounded-lg bg-bg-sunken text-text-secondary\">\n <ShoppingBag className=\"h-6 w-6\" />\n </div>\n <div className=\"min-w-0\">\n <p className=\"text-sm font-semibold text-text-primary\">{order.cartName}</p>\n </div>\n </div>\n\n <button\n type=\"button\"\n onClick={() => navigateTo(`/customer/cart/${order.cartId}`)}\n className=\"w-full rounded-lg border border-border-subtle px-4 py-2.5 text-sm font-medium text-text-primary hover:bg-accent transition-colors\"\n >\n View Cart Menu\n </button>\n </div>\n\n {/* Location Info */}\n {hasAddress && (\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-5\">\n <h3 className=\"text-base font-semibold text-text-primary mb-3\">Service Location</h3>\n <div className=\"flex items-start gap-3\">\n <MapPin className=\"mt-0.5 h-5 w-5 shrink-0 text-text-secondary\" />\n <div>\n {addr.street && <p className=\"text-sm text-text-primary\">{addr.street}</p>}\n <p className=\"text-sm text-text-secondary\">\n {[addr.area, addr.city].filter(Boolean).join(', ')}\n {addr.pincode ? ` - ${addr.pincode}` : ''}\n </p>\n {addr.landmark && (\n <p className=\"text-xs text-text-secondary mt-1\">Landmark: {addr.landmark}</p>\n )}\n </div>\n </div>\n </div>\n )}\n\n {/* Price Breakdown */}\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-5\">\n <h3 className=\"text-base font-semibold text-text-primary mb-3\">Price Breakdown</h3>\n <div className=\"space-y-2.5 text-sm\">\n <div className=\"flex justify-between\">\n <span className=\"text-text-secondary\">Subtotal</span>\n <span className=\"text-text-primary\">\n {formatCurrency(order.subtotal, { minimumFractionDigits: 0 })}\n </span>\n </div>\n <div className=\"flex justify-between\">\n <span className=\"text-text-secondary\">Delivery Fee</span>\n <span className=\"text-text-primary\">\n {order.deliveryFee === 0\n ? 'FREE'\n : formatCurrency(order.deliveryFee, { minimumFractionDigits: 0 })}\n </span>\n </div>\n <div className=\"flex justify-between\">\n <span className=\"text-text-secondary\">Tax</span>\n <span className=\"text-text-primary\">\n {formatCurrency(order.taxes, { minimumFractionDigits: 0 })}\n </span>\n </div>\n {order.discount != null && order.discount > 0 && (\n <div className=\"flex justify-between\">\n <span className=\"text-status-success-text\">Discount</span>\n <span className=\"text-status-success-text\">\n -{formatCurrency(order.discount, { minimumFractionDigits: 0 })}\n </span>\n </div>\n )}\n <div className=\"flex justify-between border-t border-border-subtle pt-2.5\">\n <span className=\"font-semibold text-text-primary\">Total</span>\n <span className=\"font-bold text-text-primary\">\n {formatCurrency(order.total, { minimumFractionDigits: 0 })}\n </span>\n </div>\n </div>\n </div>\n\n {/* Booking Info */}\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-5\">\n <h3 className=\"text-base font-semibold text-text-primary mb-3\">Booking Info</h3>\n <div className=\"space-y-3\">\n <div className=\"flex items-center gap-2\">\n <CalendarCheck className=\"h-4 w-4 text-text-secondary\" />\n <div>\n <p className=\"text-xs text-text-secondary\">Booked On</p>\n <p className=\"text-sm text-text-primary\">{formatDate(order.orderDate)}</p>\n </div>\n </div>\n <div className=\"flex items-center gap-2\">\n <CheckCircle2 className=\"h-4 w-4 text-text-secondary\" />\n <div>\n <p className=\"text-xs text-text-secondary\">Payment</p>\n <p className=\"text-sm text-text-primary capitalize\">\n {order.paymentMethod} · {order.paymentStatus}\n </p>\n </div>\n </div>\n </div>\n </div>\n\n {/* Cancel Button */}\n {canCancel && (\n <button\n type=\"button\"\n onClick={handleCancelBooking}\n disabled={cancelOrder.isPending}\n className={cn(\n 'w-full inline-flex items-center justify-center gap-2 rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-3 text-sm font-medium text-status-error-text transition-colors',\n cancelOrder.isPending\n ? 'opacity-60 cursor-not-allowed'\n : 'hover:bg-status-error-bg-subtle'\n )}\n >\n {cancelOrder.isPending ? (\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n ) : (\n <XCircle className=\"h-4 w-4\" />\n )}\n Cancel Booking\n </button>\n )}\n </div>\n </div>\n\n {/* Rate Service Modal */}\n {showRateModal && (\n <div className=\"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4\">\n <div className=\"w-full max-w-md rounded-lg border border-border-subtle bg-bg-surface shadow-lg\">\n <div className=\"p-5\">\n <div className=\"flex items-center justify-between mb-4\">\n <h3 className=\"text-lg font-semibold text-text-primary\">Rate this service</h3>\n <button\n type=\"button\"\n onClick={() => setShowRateModal(false)}\n className=\"rounded-md p-2 text-text-secondary hover:bg-accent hover:text-text-primary transition-colors\"\n >\n <X className=\"h-4 w-4\" />\n </button>\n </div>\n\n <div className=\"mb-4\">\n <label className=\"block text-sm font-medium text-text-primary mb-2\">\n Your rating\n </label>\n <div className=\"flex items-center gap-1\">\n {[1, 2, 3, 4, 5].map((star) => (\n <button\n key={star}\n type=\"button\"\n onClick={() => setRating(star)}\n className=\"p-0.5\"\n aria-label={`${star} star${star > 1 ? 's' : ''}`}\n >\n <Star\n className={cn(\n 'h-7 w-7',\n star <= rating\n ? 'fill-status-warning-text text-status-warning-text'\n : 'fill-none text-text-secondary/40'\n )}\n />\n </button>\n ))}\n </div>\n </div>\n\n <div className=\"mb-5\">\n <label className=\"block text-sm font-medium text-text-primary mb-1.5\">\n Review <span className=\"text-text-secondary font-normal\">(optional)</span>\n </label>\n <textarea\n rows={4}\n value={reviewText}\n onChange={(e) => setReviewText(e.target.value)}\n placeholder=\"Share your experience with this service...\"\n className=\"w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] resize-none\"\n />\n </div>\n\n <div className=\"flex items-center gap-3\">\n <button\n type=\"button\"\n onClick={handleSubmitRating}\n disabled={createReview.isPending}\n className={cn(\n 'flex-1 inline-flex items-center justify-center gap-2 rounded-lg bg-foreground px-4 py-2.5 text-sm font-medium text-background transition-opacity',\n createReview.isPending ? 'opacity-60 cursor-not-allowed' : 'hover:opacity-90'\n )}\n >\n {createReview.isPending && <Loader2 className=\"h-4 w-4 animate-spin\" />}\n Submit Rating\n </button>\n <button\n type=\"button\"\n onClick={() => setShowRateModal(false)}\n className=\"rounded-lg border border-border-subtle px-4 py-2.5 text-sm font-medium text-text-primary hover:bg-accent transition-colors\"\n >\n Cancel\n </button>\n </div>\n </div>\n </div>\n </div>\n )}\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAmCA,IAAMA,IAAgB;AAiBtB,SAAgBC,IAAqB;CACnC,IAAM,EAAE,iBAAcC,EAAiC,GACjD,EAAE,eAAY,mBAAgBC,EAAa,GAC3C,EAAE,MAAMC,GAAO,iBAAcC,EAASC,CAAS,GAC/CC,IAAeC,EAAgB,GAC/BC,IAAcC,EAAqB,GACnC,CAACC,GAAeC,KAAoBC,EAAwB,IAAI,GAChE,CAACC,GAAeC,KAAoBF,EAAS,EAAK,GAClD,CAACG,GAAQC,KAAaJ,EAAS,CAAC,GAChC,CAACK,GAAYC,KAAiBN,EAAS,EAAE,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,GACtBI,EAAc,EAAE,GAChBC,EAAW,yCAAyC;WACtD;WACA,eAAeA,EAAW,iDAAiD;UAC7E,CACF,IAnBEA,EAAW,sCAAsC;SAoBrD;SAmUgB,UAAUb,EAAa;SACvB,WAAWyC,EACT,oJACAzC,EAAa,YAAY,kCAAkC,kBAC7D;SAPF,UAAA,CASGA,EAAa,aAAa,kBAAC4C,GAAD,EAAS,WAAU,uBAAwB,CAAA,GAAE,eAElE;QACR,CAAA,GAAA,kBAAC,UAAD;SACE,MAAK;SACL,eAAepC,EAAiB,EAAK;SACrC,WAAU;SACX,UAAA;QAEO,CAAA,CACL;;MACF;;IACF,CAAA;GACF,CAAA;EAEG;;AAEhB"}
|
|
1
|
+
{"version":3,"file":"BookingDetailsPage.js","names":["_Fragment","Fragment$1","SUPPORT_EMAIL","BookingDetailsPage","useParams","useKadaikodi","order","useOrder","bookingId","createReview","useCreateReview","cancelOrder","useUpdateOrderStatus","appointment","appointmentResolved","appointmentLookupFailed","refetchAppointment","appointmentFetching","useOrderAppointment","appointmentSettings","appointmentSettingsFailed","refetchAppointmentSettings","appointmentSettingsFetching","useAppointmentSettings","queryClient","useQueryClient","appointmentStatus","seenAppointmentStatus","useRef","previous","cancelAppointment","useCancelAppointment","rescheduleAppointment","useRescheduleAppointment","showReschedule","setShowReschedule","useState","newSlot","setNewSlot","statusMessage","setStatusMessage","showRateModal","setShowRateModal","rating","setRating","reviewText","setReviewText","showStatus","msg","timeline","useMemo","isLoading","PageLayout","EmptyState","CalendarCheck","navigateTo","isCancelled","isCompleted","appointmentOpen","customerCanChangeAppointment","canCancel","canReschedule","appointmentTimezone","addr","hasAddress","alreadyRated","ArrowLeft","StatusBadge","PagePurpose","CheckCircle2","GlassCard","formatDate","item","formatCurrency","index","Clock","formatAppointmentTime","Loader2","AppointmentSlotPicker","error","ShoppingBag","Timeline","event","Headphones","cn","Star","MapPin","XCircle","X","star","currentUser"],"sources":["../../../../src/kadaikodi/pages/customer/BookingDetailsPage.tsx"],"sourcesContent":["/**\n * Booking Details Page\n * @module kadaikodi/pages/customer\n *\n * Detailed view of a service booking with service name, provider info,\n * scheduled date/time, booking status timeline, location info,\n * price breakdown, Contact Support button, Rate Service button (when completed),\n * Cart Information sidebar, cancel button.\n * Service bookings (BOFF-3965) also show the appointment slot with\n * reschedule (real availability) and appointment-aware cancellation.\n * Uses route param :bookingId (the order id) from useParams().\n */\n\nimport { useEffect, useMemo, useRef, useState } from 'react';\nimport { useQueryClient } from '@tanstack/react-query';\nimport { useParams } from 'react-router';\nimport {\n ArrowLeft,\n MapPin,\n Star,\n CheckCircle2,\n XCircle,\n ShoppingBag,\n CalendarCheck,\n Headphones,\n Loader2,\n X,\n Clock,\n} from 'lucide-react';\nimport { GlassCard, PagePurpose } from '@burdenoff/fe-libs/ui';\nimport { PageLayout } from '../../components/PageLayout';\nimport { StatusBadge } from '../../components/StatusBadge';\nimport { EmptyState } from '../../components/EmptyState';\nimport { Timeline, type TimelineItem } from '../../components/viz';\nimport { useKadaikodi } from '../../context/KadaikodiContext';\nimport { useOrder, useCreateReview, useUpdateOrderStatus } from '../../hooks/useKadaikodiApi';\nimport {\n formatAppointmentTime,\n useAppointmentSettings,\n useCancelAppointment,\n customerCanChangeAppointment,\n useOrderAppointment,\n useRescheduleAppointment,\n} from '../../hooks/useAppointmentsApi';\nimport { AppointmentSlotPicker } from '../../components/AppointmentSlotPicker';\nimport { cn } from '../../utils/cn';\nimport { formatCurrency, formatDate } from '../../utils/formatters';\n\nconst SUPPORT_EMAIL = 'support@kadaikodi.com';\n\n// ============================================================================\n// Types\n// ============================================================================\n\ninterface BookingTimelineEvent {\n status: string;\n label: string;\n timestamp: string | null;\n completed: boolean;\n}\n\n// ============================================================================\n// Component\n// ============================================================================\n\nexport function BookingDetailsPage() {\n const { bookingId } = useParams<{ bookingId: string }>();\n const { navigateTo, currentUser } = useKadaikodi();\n const { data: order, isLoading } = useOrder(bookingId);\n const createReview = useCreateReview();\n const cancelOrder = useUpdateOrderStatus();\n // `isSuccess` separates \"not an appointment\" (null) from \"still loading\" (undefined).\n const {\n data: appointment,\n isSuccess: appointmentResolved,\n isError: appointmentLookupFailed,\n refetch: refetchAppointment,\n isFetching: appointmentFetching,\n } = useOrderAppointment(bookingId);\n const {\n data: appointmentSettings,\n isError: appointmentSettingsFailed,\n refetch: refetchAppointmentSettings,\n isFetching: appointmentSettingsFetching,\n } = useAppointmentSettings(appointment?.providerId);\n const queryClient = useQueryClient();\n const appointmentStatus = appointment?.status;\n // The appointment is polled while active; when its status moves (e.g. the\n // provider completes it in another session) refresh the paired order so the\n // page status, timeline and rating action follow.\n const seenAppointmentStatus = useRef(appointmentStatus);\n useEffect(() => {\n const previous = seenAppointmentStatus.current;\n seenAppointmentStatus.current = appointmentStatus;\n if (previous !== undefined && appointmentStatus !== previous) {\n void queryClient.invalidateQueries({ queryKey: ['kadaikodi', 'order', bookingId] });\n }\n }, [appointmentStatus, queryClient, bookingId]);\n const cancelAppointment = useCancelAppointment();\n const rescheduleAppointment = useRescheduleAppointment();\n const [showReschedule, setShowReschedule] = useState(false);\n const [newSlot, setNewSlot] = useState('');\n const [statusMessage, setStatusMessage] = useState<string | null>(null);\n const [showRateModal, setShowRateModal] = useState(false);\n const [rating, setRating] = useState(5);\n const [reviewText, setReviewText] = useState('');\n\n const showStatus = (msg: string) => {\n setStatusMessage(msg);\n setTimeout(() => setStatusMessage(null), 3000);\n };\n\n // Build the timeline from the order's real recorded events; fall back to a\n // single \"order placed\" milestone derived from the order date.\n const timeline = useMemo<BookingTimelineEvent[]>(() => {\n if (!order) return [];\n if (order.timeline.length > 0) {\n return order.timeline.map((e) => ({\n status: e.status,\n label: e.description || e.status,\n timestamp: e.timestamp,\n completed: true,\n }));\n }\n return [\n { status: 'placed', label: 'Order placed', timestamp: order.orderDate, completed: true },\n ];\n }, [order]);\n\n if (isLoading) {\n return (\n <PageLayout title=\"Booking Details\">\n <div className=\"flex items-center justify-center py-20\">\n <div className=\"h-12 w-12 animate-spin rounded-full border-b-2 border-foreground\" />\n </div>\n </PageLayout>\n );\n }\n\n if (!order) {\n return (\n <PageLayout title=\"Booking Not Found\">\n <EmptyState\n icon={<CalendarCheck className=\"h-12 w-12\" />}\n title=\"Booking not found\"\n description={`No booking found with ID \"${bookingId}\".`}\n action={\n <button\n type=\"button\"\n onClick={() => navigateTo('/customer/dashboard')}\n className=\"rounded-lg bg-foreground px-4 py-2 text-sm font-medium text-background hover:opacity-90 transition-opacity\"\n >\n Go to Dashboard\n </button>\n }\n />\n </PageLayout>\n );\n }\n\n const isCancelled = order.status === 'cancelled';\n const isCompleted = order.status === 'delivered';\n // Service bookings follow the appointment lifecycle and the provider's\n // change deadline (mirrors the service; re-evaluated on every poll render).\n // Without the provider's settings the deadline is unknown, so no actions.\n const appointmentOpen =\n appointment != null &&\n appointmentSettings != null &&\n customerCanChangeAppointment(\n appointment,\n appointmentSettings.cancellationCutoffHours,\n Date.now()\n );\n // Withhold cancellation until the appointment lookup completes, so a service\n // booking is never cancelled through the generic order path.\n const canCancel =\n appointmentResolved && (appointment ? appointmentOpen : !isCancelled && !isCompleted);\n const canReschedule =\n appointment != null && appointmentOpen && appointment.timing === 'SCHEDULED';\n // Appointment times are shown only in the provider's configured timezone,\n // never in a guessed one.\n const appointmentTimezone = appointmentSettings?.timezone;\n const addr = order.deliveryAddress;\n const hasAddress = Boolean(addr.street || addr.area || addr.city);\n\n const alreadyRated = order.rating != null && order.rating > 0;\n\n const handleSubmitRating = () => {\n if (!currentUser?.id) {\n showStatus('Please sign in to rate this service.');\n return;\n }\n createReview.mutate(\n {\n providerId: order.cartId,\n orderId: order.id,\n customerId: currentUser.id,\n rating,\n review: reviewText.trim() || undefined,\n },\n {\n onSuccess: () => {\n setShowRateModal(false);\n setReviewText('');\n showStatus('Thanks! Your rating has been submitted.');\n },\n onError: () => showStatus('Could not submit your rating. Please try again.'),\n }\n );\n };\n\n const handleReschedule = () => {\n if (!appointment || !newSlot || !appointmentSettings) return;\n // Re-check the deadline and status at submit time: the form may have been\n // left open past the change cutoff or while the provider moved the booking.\n const stillChangeable =\n appointment.timing === 'SCHEDULED' &&\n customerCanChangeAppointment(\n appointment,\n appointmentSettings.cancellationCutoffHours,\n Date.now()\n );\n if (!stillChangeable) {\n setShowReschedule(false);\n setNewSlot('');\n showStatus('This appointment can no longer be rescheduled.');\n return;\n }\n rescheduleAppointment.mutate(\n { id: appointment.id, scheduledAt: newSlot },\n {\n onSuccess: () => {\n setShowReschedule(false);\n setNewSlot('');\n showStatus('Your appointment has been moved to the new slot.');\n },\n onError: (error) => showStatus(error.message || 'Could not reschedule. Please try again.'),\n }\n );\n };\n\n const handleCancelBooking = () => {\n if (!appointmentResolved) return;\n if (!window.confirm('Cancel this booking? This cannot be undone.')) return;\n if (appointment) {\n // The confirmation dialog may stay open past the change cutoff: re-check\n // eligibility after the customer confirms, before calling the service.\n const stillCancellable =\n appointmentSettings != null &&\n customerCanChangeAppointment(\n appointment,\n appointmentSettings.cancellationCutoffHours,\n Date.now()\n );\n if (!stillCancellable) {\n showStatus('This appointment can no longer be cancelled.');\n return;\n }\n cancelAppointment.mutate(\n { id: appointment.id },\n {\n onSuccess: () => showStatus('Your booking has been cancelled.'),\n onError: (error) =>\n showStatus(error.message || 'Could not cancel the booking. Please try again.'),\n }\n );\n return;\n }\n cancelOrder.mutate(\n { id: order.id, status: 'CANCELLED' },\n {\n onSuccess: () => showStatus('Your booking has been cancelled.'),\n onError: () => showStatus('Could not cancel the booking. Please try again.'),\n }\n );\n };\n\n return (\n <PageLayout\n title={\n <div className=\"flex items-center gap-3\">\n <button\n type=\"button\"\n onClick={() => navigateTo('/customer/dashboard')}\n className=\"rounded-md p-1 text-text-secondary hover:bg-accent hover:text-text-primary transition-colors\"\n >\n <ArrowLeft className=\"h-5 w-5\" />\n </button>\n <span>Booking #{order.id}</span>\n </div>\n }\n actions={<StatusBadge status={order.status} />}\n >\n <PagePurpose className=\"mb-4\">\n The full picture of one service booking — who's providing it, what was ordered, what it\n costs, and the actions you can take such as contacting support or cancelling.\n </PagePurpose>\n\n {/* Status message */}\n {statusMessage && (\n <div className=\"mb-4 rounded-lg border border-status-success-text/30 bg-status-success-bg-subtle p-3 flex items-center gap-2\">\n <CheckCircle2 className=\"h-4 w-4 text-status-success-text shrink-0\" />\n <p className=\"text-sm text-status-success-text\">{statusMessage}</p>\n </div>\n )}\n\n <div className=\"grid grid-cols-1 gap-6 lg:grid-cols-3\">\n {/* Left: Main Content */}\n <div className=\"lg:col-span-2 space-y-6\">\n {/* Service Info — the one emphasis zone */}\n <GlassCard treatment=\"glass\" glow className=\"p-6\">\n <h2 className=\"text-lg font-semibold text-text-primary\">{order.cartName}</h2>\n <p className=\"mt-1 text-sm text-text-secondary\">\n Order placed on {formatDate(order.orderDate)}\n </p>\n\n {order.items.length > 0 && (\n <div className=\"mt-4 space-y-1.5\">\n {order.items.map((item, index) => (\n <div key={item.id || index} className=\"flex justify-between text-sm\">\n <span className=\"text-text-primary\">\n {item.quantity}x {item.name}\n </span>\n <span className=\"text-text-secondary\">\n {formatCurrency(item.price * item.quantity, { minimumFractionDigits: 0 })}\n </span>\n </div>\n ))}\n </div>\n )}\n </GlassCard>\n\n {/* Appointment slot (service bookings) */}\n {appointment && (\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-6\">\n <div className=\"flex items-start justify-between gap-3\">\n <div>\n <h2 className=\"text-base font-semibold text-text-primary\">Appointment</h2>\n <p className=\"mt-1 flex items-center gap-2 text-sm text-text-primary\">\n <Clock className=\"h-4 w-4 text-text-secondary\" />\n {appointmentTimezone ? (\n <>\n {formatAppointmentTime(appointment.scheduledAt, appointmentTimezone, {\n weekday: 'short',\n day: 'numeric',\n month: 'short',\n hour: 'numeric',\n minute: '2-digit',\n })}{' '}\n · {appointment.durationMinutes} min\n </>\n ) : appointmentSettingsFailed ? (\n <span className=\"flex flex-wrap items-center gap-2 text-status-error-text\">\n Could not load the appointment time.\n <button\n type=\"button\"\n onClick={() => void refetchAppointmentSettings()}\n disabled={appointmentSettingsFetching}\n className=\"rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-accent disabled:opacity-60 disabled:cursor-not-allowed\"\n >\n Retry\n </button>\n </span>\n ) : (\n <span className=\"inline-flex items-center gap-2 text-text-secondary\">\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n Loading time...\n </span>\n )}\n </p>\n {appointment.offering && (\n <p className=\"mt-1 text-xs text-text-secondary\">{appointment.offering.name}</p>\n )}\n {appointment.cancellationReason && (\n <p className=\"mt-1 text-xs text-text-secondary\">\n Reason: {appointment.cancellationReason}\n </p>\n )}\n </div>\n <StatusBadge status={appointment.status} />\n </div>\n\n {canReschedule && !showReschedule && (\n <button\n type=\"button\"\n onClick={() => setShowReschedule(true)}\n className=\"mt-4 rounded-lg border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary hover:bg-accent transition-colors\"\n >\n Reschedule\n </button>\n )}\n {canReschedule && appointmentSettings && (\n <p className=\"mt-2 text-xs text-text-secondary\">\n Changes are allowed until {appointmentSettings.cancellationCutoffHours} hour\n {appointmentSettings.cancellationCutoffHours === 1 ? '' : 's'} before the slot.\n </p>\n )}\n\n {showReschedule && canReschedule && (\n <div className=\"mt-4 space-y-4 border-t border-border-subtle pt-4\">\n <AppointmentSlotPicker\n providerId={appointment.providerId}\n offeringId={appointment.offeringId}\n value={newSlot}\n onChange={setNewSlot}\n excludeStartsAt={appointment.scheduledAt}\n />\n <div className=\"flex gap-3\">\n <button\n type=\"button\"\n onClick={handleReschedule}\n disabled={!newSlot || rescheduleAppointment.isPending}\n className=\"inline-flex items-center gap-2 rounded-lg bg-foreground px-4 py-2 text-sm font-medium text-background transition-opacity hover:opacity-90 disabled:opacity-60 disabled:cursor-not-allowed\"\n >\n {rescheduleAppointment.isPending && (\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n )}\n Confirm New Slot\n </button>\n <button\n type=\"button\"\n onClick={() => {\n setShowReschedule(false);\n setNewSlot('');\n }}\n className=\"rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-accent transition-colors\"\n >\n Keep Current Slot\n </button>\n </div>\n </div>\n )}\n </div>\n )}\n\n {/* Provider Info */}\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-6\">\n <h2 className=\"text-base font-semibold text-text-primary mb-4\">Service Provider</h2>\n <div className=\"flex items-center gap-4\">\n <div className=\"flex h-12 w-12 items-center justify-center rounded-full bg-bg-sunken text-text-secondary\">\n <ShoppingBag className=\"h-6 w-6\" />\n </div>\n <div className=\"flex-1 min-w-0\">\n <p className=\"text-sm font-semibold text-text-primary\">{order.cartName}</p>\n </div>\n <button\n type=\"button\"\n onClick={() => navigateTo(`/customer/cart/${order.cartId}`)}\n className=\"rounded-lg border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary hover:bg-accent transition-colors\"\n >\n View Cart\n </button>\n </div>\n </div>\n\n {/* Booking Status Timeline */}\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-6\">\n <h2 className=\"text-base font-semibold text-text-primary mb-5\">Booking Timeline</h2>\n <Timeline\n items={timeline.map((event, index): TimelineItem => ({\n id: `${event.status}-${index}`,\n title: event.label,\n tone:\n event.status === 'cancelled' ? 'danger' : event.completed ? 'success' : 'muted',\n time: event.timestamp ? formatDate(event.timestamp) : 'Pending',\n }))}\n />\n </div>\n\n {/* Action Buttons: Contact Support + Rate Service */}\n <div className=\"flex flex-col sm:flex-row gap-3\">\n <a\n href={`mailto:${SUPPORT_EMAIL}?subject=${encodeURIComponent(\n `Support request — Booking #${order.id}`\n )}`}\n className=\"flex-1 flex items-center justify-center gap-2 rounded-lg border border-border-subtle px-4 py-3 text-sm font-medium text-text-primary hover:bg-accent transition-colors\"\n >\n <Headphones className=\"h-4 w-4\" />\n Contact Support\n </a>\n\n {isCompleted && (\n <button\n type=\"button\"\n disabled={alreadyRated}\n onClick={() => setShowRateModal(true)}\n className={cn(\n 'flex-1 flex items-center justify-center gap-2 rounded-lg px-4 py-3 text-sm font-medium transition-opacity',\n alreadyRated\n ? 'bg-bg-sunken text-text-secondary cursor-not-allowed'\n : 'bg-foreground text-background hover:opacity-90'\n )}\n >\n <Star className=\"h-4 w-4\" />\n {alreadyRated ? 'Rated' : 'Rate Service'}\n </button>\n )}\n </div>\n </div>\n\n {/* Right: Sidebar */}\n <div className=\"space-y-6\">\n {/* Cart Information */}\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-5\">\n <h3 className=\"text-base font-semibold text-text-primary mb-3\">Cart Information</h3>\n <div className=\"flex items-center gap-3 mb-4\">\n <div className=\"flex h-14 w-14 shrink-0 items-center justify-center rounded-lg bg-bg-sunken text-text-secondary\">\n <ShoppingBag className=\"h-6 w-6\" />\n </div>\n <div className=\"min-w-0\">\n <p className=\"text-sm font-semibold text-text-primary\">{order.cartName}</p>\n </div>\n </div>\n\n <button\n type=\"button\"\n onClick={() => navigateTo(`/customer/cart/${order.cartId}`)}\n className=\"w-full rounded-lg border border-border-subtle px-4 py-2.5 text-sm font-medium text-text-primary hover:bg-accent transition-colors\"\n >\n View Cart Menu\n </button>\n </div>\n\n {/* Location Info */}\n {hasAddress && (\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-5\">\n <h3 className=\"text-base font-semibold text-text-primary mb-3\">Service Location</h3>\n <div className=\"flex items-start gap-3\">\n <MapPin className=\"mt-0.5 h-5 w-5 shrink-0 text-text-secondary\" />\n <div>\n {addr.street && <p className=\"text-sm text-text-primary\">{addr.street}</p>}\n <p className=\"text-sm text-text-secondary\">\n {[addr.area, addr.city].filter(Boolean).join(', ')}\n {addr.pincode ? ` - ${addr.pincode}` : ''}\n </p>\n {addr.landmark && (\n <p className=\"text-xs text-text-secondary mt-1\">Landmark: {addr.landmark}</p>\n )}\n </div>\n </div>\n </div>\n )}\n\n {/* Price Breakdown */}\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-5\">\n <h3 className=\"text-base font-semibold text-text-primary mb-3\">Price Breakdown</h3>\n <div className=\"space-y-2.5 text-sm\">\n <div className=\"flex justify-between\">\n <span className=\"text-text-secondary\">Subtotal</span>\n <span className=\"text-text-primary\">\n {formatCurrency(order.subtotal, { minimumFractionDigits: 0 })}\n </span>\n </div>\n <div className=\"flex justify-between\">\n <span className=\"text-text-secondary\">Delivery Fee</span>\n <span className=\"text-text-primary\">\n {order.deliveryFee === 0\n ? 'FREE'\n : formatCurrency(order.deliveryFee, { minimumFractionDigits: 0 })}\n </span>\n </div>\n <div className=\"flex justify-between\">\n <span className=\"text-text-secondary\">Tax</span>\n <span className=\"text-text-primary\">\n {formatCurrency(order.taxes, { minimumFractionDigits: 0 })}\n </span>\n </div>\n {order.discount != null && order.discount > 0 && (\n <div className=\"flex justify-between\">\n <span className=\"text-status-success-text\">Discount</span>\n <span className=\"text-status-success-text\">\n -{formatCurrency(order.discount, { minimumFractionDigits: 0 })}\n </span>\n </div>\n )}\n <div className=\"flex justify-between border-t border-border-subtle pt-2.5\">\n <span className=\"font-semibold text-text-primary\">Total</span>\n <span className=\"font-bold text-text-primary\">\n {formatCurrency(order.total, { minimumFractionDigits: 0 })}\n </span>\n </div>\n </div>\n </div>\n\n {/* Booking Info */}\n <div className=\"rounded-lg border border-border-subtle bg-bg-surface p-5\">\n <h3 className=\"text-base font-semibold text-text-primary mb-3\">Booking Info</h3>\n <div className=\"space-y-3\">\n <div className=\"flex items-center gap-2\">\n <CalendarCheck className=\"h-4 w-4 text-text-secondary\" />\n <div>\n <p className=\"text-xs text-text-secondary\">Booked On</p>\n <p className=\"text-sm text-text-primary\">{formatDate(order.orderDate)}</p>\n </div>\n </div>\n <div className=\"flex items-center gap-2\">\n <CheckCircle2 className=\"h-4 w-4 text-text-secondary\" />\n <div>\n <p className=\"text-xs text-text-secondary\">Payment</p>\n <p className=\"text-sm text-text-primary capitalize\">\n {order.paymentMethod} · {order.paymentStatus}\n </p>\n </div>\n </div>\n </div>\n </div>\n\n {/* The cancel path depends on whether this is an appointment. */}\n {appointmentLookupFailed && !appointmentResolved && (\n <div className=\"flex flex-wrap items-center gap-3 text-sm text-status-error-text\">\n Could not load this booking's appointment, so it cannot be changed right now.\n <button\n type=\"button\"\n onClick={() => void refetchAppointment()}\n disabled={appointmentFetching}\n className=\"rounded-md border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-accent disabled:opacity-60 disabled:cursor-not-allowed\"\n >\n Retry\n </button>\n </div>\n )}\n\n {/* Cancel Button */}\n {canCancel && (\n <button\n type=\"button\"\n onClick={handleCancelBooking}\n disabled={cancelOrder.isPending || cancelAppointment.isPending}\n className={cn(\n 'w-full inline-flex items-center justify-center gap-2 rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-3 text-sm font-medium text-status-error-text transition-colors',\n cancelOrder.isPending || cancelAppointment.isPending\n ? 'opacity-60 cursor-not-allowed'\n : 'hover:bg-status-error-bg-subtle'\n )}\n >\n {cancelOrder.isPending || cancelAppointment.isPending ? (\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n ) : (\n <XCircle className=\"h-4 w-4\" />\n )}\n Cancel Booking\n </button>\n )}\n </div>\n </div>\n\n {/* Rate Service Modal */}\n {showRateModal && (\n <div className=\"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4\">\n <div className=\"w-full max-w-md rounded-lg border border-border-subtle bg-bg-surface shadow-lg\">\n <div className=\"p-5\">\n <div className=\"flex items-center justify-between mb-4\">\n <h3 className=\"text-lg font-semibold text-text-primary\">Rate this service</h3>\n <button\n type=\"button\"\n onClick={() => setShowRateModal(false)}\n className=\"rounded-md p-2 text-text-secondary hover:bg-accent hover:text-text-primary transition-colors\"\n >\n <X className=\"h-4 w-4\" />\n </button>\n </div>\n\n <div className=\"mb-4\">\n <label className=\"block text-sm font-medium text-text-primary mb-2\">\n Your rating\n </label>\n <div className=\"flex items-center gap-1\">\n {[1, 2, 3, 4, 5].map((star) => (\n <button\n key={star}\n type=\"button\"\n onClick={() => setRating(star)}\n className=\"p-0.5\"\n aria-label={`${star} star${star > 1 ? 's' : ''}`}\n >\n <Star\n className={cn(\n 'h-7 w-7',\n star <= rating\n ? 'fill-status-warning-text text-status-warning-text'\n : 'fill-none text-text-secondary/40'\n )}\n />\n </button>\n ))}\n </div>\n </div>\n\n <div className=\"mb-5\">\n <label className=\"block text-sm font-medium text-text-primary mb-1.5\">\n Review <span className=\"text-text-secondary font-normal\">(optional)</span>\n </label>\n <textarea\n rows={4}\n value={reviewText}\n onChange={(e) => setReviewText(e.target.value)}\n placeholder=\"Share your experience with this service...\"\n className=\"w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] resize-none\"\n />\n </div>\n\n <div className=\"flex items-center gap-3\">\n <button\n type=\"button\"\n onClick={handleSubmitRating}\n disabled={createReview.isPending}\n className={cn(\n 'flex-1 inline-flex items-center justify-center gap-2 rounded-lg bg-foreground px-4 py-2.5 text-sm font-medium text-background transition-opacity',\n createReview.isPending ? 'opacity-60 cursor-not-allowed' : 'hover:opacity-90'\n )}\n >\n {createReview.isPending && <Loader2 className=\"h-4 w-4 animate-spin\" />}\n Submit Rating\n </button>\n <button\n type=\"button\"\n onClick={() => setShowRateModal(false)}\n className=\"rounded-lg border border-border-subtle px-4 py-2.5 text-sm font-medium text-text-primary hover:bg-accent transition-colors\"\n >\n Cancel\n </button>\n </div>\n </div>\n </div>\n </div>\n )}\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAgDA,IAAME,KAAgB;AAiBtB,SAAgBC,IAAqB;CACnC,IAAM,EAAE,iBAAcC,GAAiC,GACjD,EAAE,eAAY,mBAAgBC,EAAa,GAC3C,EAAE,MAAMC,GAAO,kBAAcC,GAASC,CAAS,GAC/CC,IAAeC,GAAgB,GAC/BC,IAAcC,GAAqB,GAEnC,EACJ,MAAMC,GACN,WAAWC,GACX,SAASC,GACT,SAASC,GACT,YAAYC,MACVC,GAAoBV,CAAS,GAC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eA,EAAW,iDAAiD;UAC7E,CACF,IAnBEA,EAAW,sCAAsC;SAoBrD;SAgfgB,UAAUtC,EAAa;SACvB,WAAW2E,EACT,oJACA3E,EAAa,YAAY,kCAAkC,kBAC7D;SAPF,UAAA,CASGA,EAAa,aAAa,kBAACoE,GAAD,EAAS,WAAU,uBAAwB,CAAA,GAAE,eAElE;QACR,CAAA,GAAA,kBAAC,UAAD;SACE,MAAK;SACL,eAAenC,EAAiB,EAAK;SACrC,WAAU;SACX,UAAA;QAEO,CAAA,CACL;;MACF;;IACF,CAAA;GACF,CAAA;EAEG;;AAEhB"}
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
*
|
|
5
5
|
* 4-step wizard: Location > Details > Payment > Confirmation.
|
|
6
6
|
* Progress indicator, step validation, geolocation button,
|
|
7
|
-
* address fields,
|
|
8
|
-
* urgent booking checkbox, payment method
|
|
9
|
-
* payment summary, confirmation step with
|
|
7
|
+
* address fields, service selection, "come now" or a real time slot from the
|
|
8
|
+
* provider's availability (BOFF-3965), urgent booking checkbox, payment method
|
|
9
|
+
* selection, payment summary, confirmation step with the booked appointment.
|
|
10
10
|
*/
|
|
11
11
|
export declare function DirectServiceBookingPage(): import('react').JSX.Element;
|