mirror of
https://github.com/JetSprow/J-Board-Lite.git
synced 2026-05-01 09:14:11 +05:30
Initial commit
This commit is contained in:
17
src/app/(user)/orders/orders-calculations.ts
Normal file
17
src/app/(user)/orders/orders-calculations.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
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 };
|
||||
Reference in New Issue
Block a user