Files
the-biergarten-app/web/frontend/app/features/breweries/utils/format-address.ts

10 lines
412 B
TypeScript

import type { BreweryLocation } from '../breweries.server';
export const formatBreweryAddress = (location: BreweryLocation): string => {
const streetLine = location.addressLine2
? `${location.addressLine1}, ${location.addressLine2}`
: location.addressLine1;
return `${streetLine}, ${location.cityName}, ${location.stateProvinceCode} ${location.postalCode}, ${location.countryName}`;
};