Files
J-Board-Lite/src/app/(user)/orders/orders-calculations.ts
2026-04-29 05:16:29 +10:00

18 lines
531 B
TypeScript

import type { OrderStatus } from "@prisma/client";
import type { StatusTone } from "@/components/shared/status-badge";
export {
getOrderStatusTone,
orderKindLabels,
orderStatusLabels,
} from "@/components/shared/domain-badges";
export function formatOrderTraffic(trafficGb: number | null) {
return trafficGb === null ? "—" : `${trafficGb} GB`;
}
export function formatOrderAmount(amount: { toString(): string } | number | string) {
return `¥${Number(amount).toFixed(2)}`;
}
export type { OrderStatus, StatusTone };