import type { PrivateLocation } from "@openstatus/db/src/schema"; import { getRegionInfo } from "@openstatus/regions"; import { cn } from "@/lib/utils"; export function TableCellRegion({ value, privateLocations, className, ...props }: React.ComponentProps<"div"> & { value: unknown; privateLocations?: PrivateLocation[]; }) { if (typeof value !== "string" || value.length === 0) { return (
-
); } const info = getRegionInfo(value, { location: privateLocations?.find((loc) => String(loc.id) === String(value)) ?.name, }); return (
{info.location}{" "} ({info.provider})
); }