import { Link, useNavigate } from 'react-router-dom' import { useCartStore } from '@/store/cart' import { Button } from '@/components/ui/button' import { Card, CardContent } from '@/components/ui/card' import { Minus, Plus, Trash2, ShoppingBag } from 'lucide-react' function formatPrice(price: number): string { return new Intl.NumberFormat('ja-JP', { style: 'currency', currency: 'JPY' }).format(price) } export function CartPage() { const { items, total, removeItem, updateQuantity } = useCartStore() const navigate = useNavigate() if (items.length === 0) { return (

カートは空です

Your cart is empty.

) } return (

ショッピングカート

{items.map(item => ( {/* Image */}
{item.image ? ( {item.name} ) : (
🏺
)}
{/* Info */}

{item.name}

{formatPrice(item.price)}

{/* Quantity controls */}
{item.quantity}
{/* Item total */}
{formatPrice(item.price * item.quantity)}
{/* Remove */}
))}
{/* Summary */}
合計 {formatPrice(total)}
買い物を続ける
) }