Add brewery discovery & detail pages with location-based search (#253)

This commit is contained in:
Aaron Po
2026-08-29 00:44:33 -04:00
committed by GitHub
parent 92a30b11db
commit a580314583
90 changed files with 3874 additions and 187 deletions

View File

@@ -0,0 +1,9 @@
export type DistanceUnit = 'km' | 'mi';
const METRES_PER_MILE = 1609.344;
export const formatDistance = (metres: number, unit: DistanceUnit = 'km'): string => {
const value = unit === 'mi' ? metres / METRES_PER_MILE : metres / 1000;
const rounded = value < 10 ? value.toFixed(1) : String(Math.round(value));
return `${rounded} ${unit}`;
};