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,32 @@
import type { LatLngTuple } from 'leaflet';
import { formatDistance, type DistanceUnit } from '../../../../utils/distance';
import type { BreweryWithDistance } from '../types';
interface NearbyBreweriesHeaderProps {
center: LatLngTuple | null;
withDistance: BreweryWithDistance[];
radiusKm: number;
unit: DistanceUnit;
centerLabel: string;
}
const NearbyBreweriesHeader = ({
center,
centerLabel,
radiusKm,
unit,
withDistance,
}: NearbyBreweriesHeaderProps) => {
return (
<div className="flex items-baseline justify-between gap-4 flex-wrap mb-3.5">
<h2 className="font-serif text-2xl m-0">Breweries near you</h2>
<span className="text-sm text-base-content/60">
{center
? `${withDistance.length} within ${formatDistance(radiusKm * 1000, unit)} of ${centerLabel}`
: 'Finding breweries near you…'}
</span>
</div>
);
};
export default NearbyBreweriesHeader;