fix(dashboard): Remove wrongful import of utils function (#11338)

Resolves SUP-819
This commit is contained in:
Kasper Fabricius Kristensen
2025-02-06 17:14:50 +00:00
committed by GitHub
parent 34e7fdafd2
commit 211997b137
3 changed files with 10 additions and 6 deletions
+5
View File
@@ -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 }
}
@@ -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 (