fix: unify coordinate precision labels

This commit is contained in:
ik
2026-09-21 18:12:10 +07:00
parent 31b720f7b3
commit 675cd8ba4e
7 changed files with 23 additions and 11 deletions
+1 -1
View File
@@ -37,7 +37,7 @@ export type MediaAsset = { id: string; entity_type: "fish" | "waterbody" | "tack
export const spotPath = (item: Pick<Activity, "waterbody_slug" | "x" | "y">) => `/spots/${item.waterbody_slug}-${item.x}x${item.y}`;
export { activityLevel, ago, freshnessStatus, kg, passportDisplayStatus, plural, sourceStatusLabel } from "./presentation";
export { activityLevel, ago, coordinatePrecisionLabel, freshnessStatus, kg, passportDisplayStatus, plural, sourceStatusLabel } from "./presentation";
const base = process.env.API_INTERNAL_URL || import.meta.env.API_INTERNAL_URL || "http://localhost:8000";
+6
View File
@@ -28,6 +28,12 @@ export function freshnessStatus(value: string | null | undefined, now = Date.now
return now - timestamp > 48 * 60 * 60 * 1000 ? "stale" : "fresh";
}
export type CoordinatePrecision = "exact" | "approximate" | "area" | "missing";
export function coordinatePrecisionLabel(value: CoordinatePrecision | string | null | undefined): string {
return ({ exact: "точные", approximate: "приблизительные", area: "район", missing: "не указаны" } as Record<string, string>)[value ?? ""] ?? "не указаны";
}
export type PassportStatus = "verified" | "unverified" | "incomplete" | "insufficient" | "blocked";
export type PassportDisplayStatus = PassportStatus | "conflict" | "stale";