recipes/order-tracking.tsximport { Badge, Body, BodySmall, Button, Card, Heading, Link, Stack, Text } from '@blocks/design-system'
import { Check, CircleHelp, Footprints, House, MapPin, MessageCircle, Shirt, Truck } from 'lucide-react'
import styles from './order-tracking.module.css'
const steps = [
{ label: 'Ordered' , when: 'Nov 28' },
{ label: 'Packed' , when: 'Nov 29' },
{ label: 'Shipped' , when: 'Nov 30' },
{ label: 'Out for delivery' , when: 'Today, 7:12 am' },
{ label: 'Delivered' , when: 'By 8 pm today' },
]
const currentStep = 3
type StepState = 'done' | 'current' | 'upcoming'
const statePrefix : Record <StepState , string > = { done: 'Completed: ' , current: 'Current step: ' , upcoming: 'Next: ' }
const updates = [
{ time: '2026-12-02T07:12' , date: 'Dec 2' , clock: '7:12 am' , status: 'Out for delivery' , place: 'Tacoma, WA' },
{ time: '2026-12-02T04:40' , date: 'Dec 2' , clock: '4:40 am' , status: 'Arrived at local facility' , place: 'Tacoma, WA' },
{ time: '2026-12-01T21:05' , date: 'Dec 1' , clock: '9:05 pm' , status: 'Departed regional hub' , place: 'Portland, OR' },
{ time: '2026-11-30T18:18' , date: 'Nov 30' , clock: '6:18 pm' , status: 'Picked up by carrier' , place: 'Bend, OR' },
{ time: '2026-11-30T14:02' , date: 'Nov 30' , clock: '2:02 pm' , status: 'Shipping label created' , place: 'Bend, OR' },
]
const items = [
{ name: 'Ridgeline insulated jacket' , detail: 'Spruce · M' , quantity: 1 , icon: Shirt },
{ name: 'Merino trail socks, 3 pairs' , detail: 'Charcoal · L' , quantity: 2 , icon: Footprints },
]
export default function OrderTracking () {
return (
<article aria-labelledby = "order-tracking-title" className = {styles .root}>
<Stack gap = "xl" >
<Stack gap = "sm" >
<Stack direction = "row" gap = "sm" align = "center" wrap = "wrap" >
<Text fontSize = "sm" color = "text-muted" >
Order NF-20418 · placed Nov 28
</Text >
<Badge tone = "info" >
<Truck aria-hidden />
Out for delivery
</Badge >
</Stack >
<Heading as = "h2" id = "order-tracking-title" fontSize = "xxl" >
Arriving today by 8 pm
</Heading >
<Body margin = "none" color = "text-muted" >
<MapPin aria-hidden className = {styles .inlineIcon} /> To Dana Whitfield, 88 River Road, Tacoma, WA
</Body >
</Stack >
<ol aria-label = "Order progress" className = {styles .tracker}>
{steps .map ((step, index) => {
const state : StepState = index < currentStep ? 'done' : index === currentStep ? 'current' : 'upcoming'
return (
<li key = {step .label} data-state = {state} aria-current = {state === 'current' ? 'step' : undefined } className = {styles .step}>
<span aria-hidden className = {styles .dot}>
{state === 'done' && <Check />}
{state === 'current' && <Truck />}
</span >
<span className = {styles .stepText}>
<span className = {styles .visuallyHidden}>{statePrefix[state]}</span >
<Text fontSize = "sm" fontWeight = "semibold" color = {state === 'upcoming' ? 'text-muted' : 'text' }>
{step .label}
</Text >
<Text fontSize = "xs" color = "text-muted" >
{step .when}
</Text >
</span >
</li >
)
})}
</ol >
<div className = {styles .columns}>
<Stack as = "section" gap = "md" aria-labelledby = "order-tracking-updates" >
<Stack gap = "none" >
<Heading as = "h3" id = "order-tracking-updates" fontSize = "md" >
Carrier updates
</Heading >
<BodySmall margin = "none" color = "text-muted" >
Ridgeway Parcel · tracking <Link href = "#order-tracking-carrier" >1RP 4471 9920</Link >
</BodySmall >
</Stack >
<ol className = {styles .timeline}>
{updates .map ((update) => (
<li key = {update .time}>
<Text fontSize = "sm" fontWeight = "semibold" >
{update .status}
</Text >
<Text fontSize = "xs" color = "text-muted" >
<time dateTime = {update .time}>
{update .date}, {update .clock}
</time >{' ' }
· {update .place}
</Text >
</li >
))}
</ol >
</Stack >
<Stack gap = "lg" >
<Card as = "section" aria-labelledby = "order-tracking-items" padding = "lg" borderRadius = "xl" >
<Stack gap = "md" >
<Heading as = "h3" id = "order-tracking-items" fontSize = "md" >
In this shipment
</Heading >
<Stack as = "ul" gap = "md" dangerouslySetClassName = {styles .list}>
{items .map ((item) => (
<Stack as = "li" key = {item .name} direction = "row" gap = "md" align = "center" >
<span className = {styles .art}>
<item.icon aria-hidden />
</span >
<Stack gap = "none" >
<Text fontSize = "sm" fontWeight = "semibold" >
{item .name}
</Text >
<Text fontSize = "xs" color = "text-muted" >
{item .detail} · Qty {item .quantity}
</Text >
</Stack >
</Stack >
))}
</Stack >
</Stack >
</Card >
<Stack as = "nav" gap = "sm" aria-label = "Help with this order" >
<Button as = "a" href = "#order-tracking-instructions" >
<House aria-hidden className = {styles .icon} />
Change delivery instructions
</Button >
<Button as = "a" href = "#order-tracking-problem" variant = "ghost" >
<CircleHelp aria-hidden className = {styles .icon} />
Report a problem
</Button >
<Button as = "a" href = "#order-tracking-support" variant = "ghost" >
<MessageCircle aria-hidden className = {styles .icon} />
Chat with support
</Button >
</Stack >
</Stack >
</div >
</Stack >
</article >
)
}