feat(MED-105): update order details redirect and shown page
This commit is contained in:
@@ -6,6 +6,7 @@ import { Eye } from "lucide-react";
|
||||
import Link from "next/link";
|
||||
import { formatDate } from "date-fns";
|
||||
import { IOrderLineItem } from "./types";
|
||||
import { Trans } from '@kit/ui/trans';
|
||||
|
||||
export default function OrdersItem({ orderItem }: {
|
||||
orderItem: IOrderLineItem,
|
||||
@@ -22,15 +23,13 @@ export default function OrdersItem({ orderItem }: {
|
||||
{formatDate(orderItem.item.created_at, 'dd.MM.yyyy HH:mm')}
|
||||
</TableCell>
|
||||
|
||||
{orderItem.orderStatus && (
|
||||
<TableCell className="px-6">
|
||||
{orderItem.orderStatus}
|
||||
</TableCell>
|
||||
)}
|
||||
<TableCell className="px-6 whitespace-nowrap">
|
||||
<Trans i18nKey={`orders:status.${orderItem.orderStatus}`} />
|
||||
</TableCell>
|
||||
|
||||
<TableCell className="text-right px-6">
|
||||
<span className="flex gap-x-1 justify-end w-[60px]">
|
||||
<Link href={`/home/analysis-results`} className="flex items-center justify-between text-small-regular">
|
||||
<Link href={`/home/order/${orderItem.orderId}`} className="flex items-center justify-between text-small-regular">
|
||||
<button
|
||||
className="flex gap-x-1 text-ui-fg-subtle hover:text-ui-fg-base cursor-pointer"
|
||||
>
|
||||
|
||||
@@ -9,8 +9,6 @@ import {
|
||||
import OrdersItem from "./orders-item";
|
||||
import { IOrderLineItem } from "./types";
|
||||
|
||||
const IS_SHOWN_ORDER_STATUS = true as boolean;
|
||||
|
||||
export default function OrdersTable({ orderItems, title }: {
|
||||
orderItems: IOrderLineItem[];
|
||||
title: string;
|
||||
@@ -29,10 +27,9 @@ export default function OrdersTable({ orderItems, title }: {
|
||||
<TableHead className="px-6">
|
||||
<Trans i18nKey="orders:table.createdAt" />
|
||||
</TableHead>
|
||||
{IS_SHOWN_ORDER_STATUS && (
|
||||
<TableHead className="px-6">
|
||||
</TableHead>
|
||||
)}
|
||||
<TableHead className="px-6">
|
||||
<Trans i18nKey="orders:table.status" />
|
||||
</TableHead>
|
||||
<TableHead className="px-6">
|
||||
</TableHead>
|
||||
</TableRow>
|
||||
|
||||
@@ -2,6 +2,7 @@ import { StoreOrderLineItem } from "@medusajs/types";
|
||||
|
||||
export interface IOrderLineItem {
|
||||
item: StoreOrderLineItem;
|
||||
orderId: string;
|
||||
medusaOrderId: string;
|
||||
orderId: number;
|
||||
orderStatus: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user