import type { Metadata } from "next" import Link from "next/link" import { ArrowRight, Clock, Globe, Mail, MapPin, Phone, Wrench } from "lucide-react" import { Breadcrumbs } from "@/components/breadcrumbs" import { ReviewsSection } from "@/components/reviews-section" import { GetFreeMachineCta } from "@/components/get-free-machine-cta" import { Card, CardContent } from "@/components/ui/card" import { PublicInset, PublicPageHeader, PublicSurface, } from "@/components/public-surface" import type { LocationData } from "@/lib/location-data" import { generateSEOMetadata } from "@/lib/seo" import { buildAbsoluteUrl, buildLocationRoute } from "@/lib/seo-registry" import { businessConfig } from "@/lib/seo-config" const SALT_LAKE_COUNTY = new Set([ "salt-lake-city-utah", "sandy-utah", "draper-utah", "murray-utah", "midvale-utah", "south-salt-lake-utah", "west-valley-city-utah", "west-jordan-utah", "south-jordan-utah", "riverton-utah", "herriman-utah", "holladay-utah", "millcreek-utah", "cottonwood-heights-utah", ]) const DAVIS_COUNTY = new Set([ "ogden-utah", "layton-utah", "clearfield-utah", "syracuse-utah", "clinton-utah", ]) function getCountyName(locationSlug: string) { if (SALT_LAKE_COUNTY.has(locationSlug)) { return "Salt Lake County" } if (DAVIS_COUNTY.has(locationSlug)) { return "Davis County" } return "Utah County" } function getIndustryFocus(locationData: LocationData) { const county = getCountyName(locationData.slug) const countyIndustries: Record = { "Salt Lake County": [ "offices", "warehouses", "gyms", "schools", "service businesses", ], "Davis County": [ "warehouses", "auto repair shops", "community centers", "schools", "offices", ], "Utah County": [ "offices", "training spaces", "schools", "fitness locations", "community facilities", ], } return Array.from( new Set([locationData.anecdote.customer, ...countyIndustries[county]]) ).slice(0, 5) } export function generateLocationPageMetadata( locationData: LocationData ): Metadata { return generateSEOMetadata({ title: `Vending Machines in ${locationData.city}, ${locationData.stateAbbr}`, description: `Rocky Mountain Vending provides free placement for qualifying locations, machine sales, repairs, and vending service for businesses in ${locationData.city}, ${locationData.stateAbbr}. Explore local coverage and contact options.`, path: buildLocationRoute(locationData.slug), keywords: [ `vending machines ${locationData.city.toLowerCase()}`, `vending machine repair ${locationData.city.toLowerCase()}`, `vending service ${locationData.city.toLowerCase()}`, `${locationData.city.toLowerCase()} vending company`, ...locationData.neighborhoods.map( (neighborhood) => `vending machines ${neighborhood.toLowerCase()}` ), ], }) } export function LocationLandingPage({ locationData, }: { locationData: LocationData }) { const countyName = getCountyName(locationData.slug) const industries = getIndustryFocus(locationData) const canonicalUrl = buildAbsoluteUrl(buildLocationRoute(locationData.slug)) const title = `Vending Machines in ${locationData.city}, ${locationData.stateAbbr}` const description = `Rocky Mountain Vending provides free placement for qualifying locations, machine sales, repairs, and vending service for businesses in ${locationData.city}, ${locationData.stateAbbr}.` const structuredData = { "@context": "https://schema.org", "@graph": [ { "@type": "WebPage", name: title, description, url: canonicalUrl, isPartOf: { "@type": "WebSite", name: businessConfig.name, url: businessConfig.website, }, }, { "@type": "Service", name: `${businessConfig.name} vending services in ${locationData.city}, ${locationData.stateAbbr}`, description, url: canonicalUrl, serviceType: "Free vending machine placement, vending machine sales, repairs, parts, moving, and ongoing service", provider: { "@type": "Organization", name: businessConfig.name, url: businessConfig.website, telephone: businessConfig.phoneFormatted, email: businessConfig.email, }, areaServed: { "@type": "City", name: locationData.city, containedInPlace: { "@type": "AdministrativeArea", name: countyName, }, address: { "@type": "PostalAddress", addressLocality: locationData.city, addressRegion: locationData.stateAbbr, postalCode: locationData.zipCode, addressCountry: "US", }, }, }, ], } return ( <>