fix build

This commit is contained in:
2026-04-23 15:15:21 +03:00
parent c0f78c6e18
commit 564e9e510f
13 changed files with 85 additions and 17 deletions
+19
View File
@@ -56,6 +56,25 @@ export function formatEnum(value?: string | null): string {
.join(" ")
}
type TaxLabelValue = {
name?: string | null
title?: string | null
rate?: string | number | null
}
export function formatTaxLabel(
value?: TaxLabelValue | null,
emptyFallback = "—",
): string {
const label = value?.name ?? value?.title
const rate = value?.rate
if (!label) return emptyFallback
if (rate == null || rate === "") return label
return `${label} (${rate}%)`
}
/**
* Format a number with locale-aware thousand separators.
* e.g. 150000 → "150,000"
+6 -1
View File
@@ -1,4 +1,9 @@
export const getFullName = <T extends { first_name?: string | undefined; last_name?: string | undefined }>(user?: T) => {
type NameLike = {
first_name?: string | null
last_name?: string | null
}
export const getFullName = <T extends NameLike>(user?: T | null) => {
const firstName = user?.first_name ?? ""
const lastName = user?.last_name ?? ""
return `${firstName} ${lastName}`.trim()