fix(dashboard): Remove wrongful import of utils function (#11338)
Resolves SUP-819
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@medusajs/dashboard": patch
|
||||
---
|
||||
|
||||
fix(dashboard): Remove wrongful import of utils function
|
||||
@@ -3,12 +3,12 @@ import { TFunction } from "i18next"
|
||||
export const getCanceledOrderStatus = (
|
||||
t: TFunction<"translation">,
|
||||
status: string
|
||||
) => {
|
||||
): { label: string; color: "red" } | null => {
|
||||
if (status === "canceled") {
|
||||
return { label: t("orders.status.canceled"), color: "red" }
|
||||
}
|
||||
|
||||
return
|
||||
return null
|
||||
}
|
||||
|
||||
export const getOrderPaymentStatus = (
|
||||
@@ -35,7 +35,7 @@ export const getOrderPaymentStatus = (
|
||||
],
|
||||
canceled: [t("orders.payment.status.canceled"), "red"],
|
||||
requires_action: [t("orders.payment.status.requiresAction"), "orange"],
|
||||
}[status]
|
||||
}[status] as [string, "red" | "orange" | "green"]
|
||||
|
||||
return { label, color }
|
||||
}
|
||||
|
||||
+2
-3
@@ -10,7 +10,6 @@ import {
|
||||
usePrompt,
|
||||
} from "@medusajs/ui"
|
||||
import { useTranslation } from "react-i18next"
|
||||
import { isPresent } from "../../../../../../../../core/utils/src/common/is-present"
|
||||
import { ActionMenu } from "../../../../../components/common/action-menu"
|
||||
import { useCancelOrder } from "../../../../../hooks/api/orders"
|
||||
import { useDate } from "../../../../../hooks/use-date"
|
||||
@@ -125,8 +124,8 @@ const OrderBadge = ({ order }: { order: HttpTypes.AdminOrder }) => {
|
||||
const { t } = useTranslation()
|
||||
const orderStatus = getCanceledOrderStatus(t, order.status)
|
||||
|
||||
if (!isPresent(orderStatus)) {
|
||||
return
|
||||
if (!orderStatus) {
|
||||
return null
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user