fix: unify coordinate precision labels
This commit is contained in:
@@ -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";
|
||||
|
||||
|
||||
@@ -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";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user