diff --git a/src/app/(customer)/(shop)/orders/(routes)/(landing)/page.tsx b/src/app/(customer)/(shop)/orders/(routes)/(landing)/page.tsx index 36b7e6e..3a83cda 100644 --- a/src/app/(customer)/(shop)/orders/(routes)/(landing)/page.tsx +++ b/src/app/(customer)/(shop)/orders/(routes)/(landing)/page.tsx @@ -10,6 +10,7 @@ import OrderHeader from "@/components/orders/order-header"; export default async function OrdersPage() { return
+ {/* */} { Array.from({ length: 20 }, (_, index) => ) diff --git a/src/app/(customer)/(shop)/orders/(routes)/[orderId]/page.tsx b/src/app/(customer)/(shop)/orders/(routes)/[orderId]/page.tsx index c2039ef..fbeef54 100644 --- a/src/app/(customer)/(shop)/orders/(routes)/[orderId]/page.tsx +++ b/src/app/(customer)/(shop)/orders/(routes)/[orderId]/page.tsx @@ -1,9 +1,13 @@ +import OrderStepperStatus from '@/components/orders/order-stepper-status' import React from 'react' const OrderDetail = () => { - return ( -
OrderDetail
- ) + return
+ +

در حال آماده‌سازی

+ + +
} export default OrderDetail \ No newline at end of file diff --git a/src/components/orders/order-empty.tsx b/src/components/orders/order-empty.tsx index e7c9452..3e434fc 100644 --- a/src/components/orders/order-empty.tsx +++ b/src/components/orders/order-empty.tsx @@ -1,16 +1,16 @@ import { ShoppingBagIcon } from 'lucide-react' -import React from 'react' +import Link from 'next/link' const OrderEmpty = () => { return (
- +

هنوز سفارشی ثبت نکرده‌اید

-

لیست سفارش‌های شما در حال حاضر خالی است. برای خرید از فروشگاه‌های اطراف روی دکمه زیر کلیک کنید.

- +

لیست سفارش‌های شما در حال حاضر خالی است. برای خرید از فروشگاه‌های اطراف روی دکمه زیر کلیک کنید.

+ شروع خرید
) diff --git a/src/components/orders/order-stepper-status.tsx b/src/components/orders/order-stepper-status.tsx new file mode 100644 index 0000000..8d0cba9 --- /dev/null +++ b/src/components/orders/order-stepper-status.tsx @@ -0,0 +1,103 @@ +import React from 'react' +import { Check } from 'lucide-react' + +type StepStatus = 'completed' | 'current' | 'upcoming' + +interface Step { + label: string + status: StepStatus +} + +interface OrderStepperStatusProps { + /** ایندکس مرحله فعلی (۰-based). مراحل قبل completed، خودش current، بعد upcoming */ + currentStep?: number + steps?: string[] +} + +const DEFAULT_STEPS = [ + 'ثبت شد', + 'پذیرفته شد', + 'آماده‌سازی', + 'ارسال شد', + 'تحویل', +] + +const OrderStepperStatus = ({ + currentStep = 2, + steps = DEFAULT_STEPS, +}: OrderStepperStatusProps) => { + const computedSteps: Step[] = steps.map((label, index) => { + if (index < currentStep) return { label, status: 'completed' } + if (index === currentStep) return { label, status: 'current' } + return { label, status: 'upcoming' } + }) + + return ( +
+ {/* ردیف دایره‌ها و خطوط — خط دقیقاً به لبه دایره می‌چسبد */} +
+ {computedSteps.map((step, index) => { + const isLast = index === computedSteps.length - 1 + const isCompleted = step.status === 'completed' + const isCurrent = step.status === 'current' + const isUpcoming = step.status === 'upcoming' + + const circleBg = isUpcoming ? 'bg-gray-300' : 'bg-primary-action' + const nextLineBg = + index < currentStep ? 'bg-primary-action' : 'bg-gray-300' + + return ( + +
+ {isCompleted && ( + + )} + {isCurrent && ( +
+ )} +
+ + {!isLast && ( +
+ )} + + ) + })} +
+ + {/* ردیف لیبل‌ها — دقیقاً زیر هر دایره */} +
+ {computedSteps.map((step, index) => { + const isLast = index === computedSteps.length - 1 + const isUpcoming = step.status === 'upcoming' + const textColor = isUpcoming + ? 'text-gray-500' + : 'text-primary-action' + + return ( + +
+ + {step.label} + +
+ {!isLast &&
} + + ) + })} +
+
+ ) +} + +export default OrderStepperStatus \ No newline at end of file