import { notFound } from "next/navigation" import type { Metadata } from "next" import Image from "next/image" import Link from "next/link" import { CheckCircle2, CreditCard, Refrigerator, ShoppingCart, } from "lucide-react" import { generateSEOMetadata, generateStructuredData } from "@/lib/seo" import { getPageBySlug } from "@/lib/wordpress-data-loader" import { PublicInset, PublicPageHeader, PublicSectionHeader, PublicSurface, } from "@/components/public-surface" import { GetFreeMachineCta } from "@/components/get-free-machine-cta" import { Breadcrumbs } from "@/components/breadcrumbs" import { Button } from "@/components/ui/button" const WORDPRESS_SLUG = "vending-machines-for-sale-in-utah" const machineHighlights = [ "Snack, drink, combo, and card-reader-ready equipment options", "New and used machine guidance based on traffic, budget, and product mix", "Local help with payment hardware, installation planning, and next-step questions", ] const machineOptions = [ { title: "Snack and drink machines", description: "Traditional snack, beverage, and combo machines for breakrooms, customer spaces, and mixed-traffic locations.", icon: ShoppingCart, }, { title: "Cashless payment hardware", description: "Card reader and mobile-payment options that help modernize older machines or support new installs.", icon: CreditCard, }, { title: "Refrigerated equipment", description: "Cold drink and refrigerated machine options for workplaces that need dependable temperature-controlled service.", icon: Refrigerator, }, ] const buyingSteps = [ { title: "Tell us about the location", body: "We learn about traffic, available space, product needs, and whether you are comparing free placement with a direct purchase.", }, { title: "Compare the right machine options", body: "We help narrow down machine styles, payment hardware, and new-versus-used tradeoffs so you are looking at realistic fits.", }, { title: "Plan install and support", body: "Once you know what you want, we can talk through delivery, setup, payment configuration, and any follow-up service needs.", }, ] function normalizeWpImageUrl(url?: string) { if (!url) return null return url.replace("https:///", "https://rockymountainvending.com/") } export async function generateMetadata(): Promise { const page = getPageBySlug(WORDPRESS_SLUG) if (!page) { return { title: "Page Not Found | Rocky Mountain Vending", } } return generateSEOMetadata({ title: page.title || "Vending Machines for Sale in Utah", description: page.seoDescription || page.excerpt || "", excerpt: page.excerpt, date: page.date, modified: page.modified, image: page.images?.[0]?.localPath, path: "/vending-machines/machines-for-sale", }) } export default async function MachinesForSalePage() { try { const page = getPageBySlug(WORDPRESS_SLUG) if (!page) { notFound() } const structuredData = (() => { try { return generateStructuredData({ title: page.title || "Vending Machines for Sale in Utah", description: page.seoDescription || page.excerpt || "", url: page.link || page.urlPath || "https://rockymountainvending.com/vending-machines/machines-for-sale/", datePublished: page.date, dateModified: page.modified || page.date, type: "WebPage", }) } catch { return { "@context": "https://schema.org", "@type": "WebPage", headline: page.title || "Vending Machines for Sale in Utah", description: page.seoDescription || "", url: "https://rockymountainvending.com/vending-machines/machines-for-sale/", } } })() const heroImage = normalizeWpImageUrl(page.images?.[0]?.url) ?? "https://rockymountainvending.com/wp-content/uploads/2024/01/EH0A1551-HDR.webp" const comboImage = normalizeWpImageUrl(page.images?.[1]?.url) ?? "https://rockymountainvending.com/wp-content/uploads/2022/06/Seage-HY900-Combo.webp" const paymentImage = normalizeWpImageUrl(page.images?.[2]?.url) ?? "https://rockymountainvending.com/wp-content/uploads/2024/01/Parlevel-Pay-Plus.jpg" return ( <>