export const OrderHistoryPage: React.FC = () => {
const navigate = useNavigate();
const orders = [
{ id: '1', productName: 'MacBook Pro', status: 'delivered' as const, total: 298000 },
{ id: '2', productName: 'iPad Air', status: 'shipped' as const, total: 92800 }
];
const handleViewDetail = (orderId: string) => { navigate(`/orders/${orderId}`); };
const handleRequestInvoice = (orderId: string) => { navigate(`/orders/${orderId}/invoice`); };
return (
{/* 固定的な遷移は自己完結 */}
注文履歴
{orders.map(order => (
handleViewDetail(order.id)} {/* 文脈的な遷移は制御 */}
onRequestInvoice={() => handleRequestInvoice(order.id)}
/>
))}
);
};