import { getServiceBySlug, getLocationBySlug, getProjectsByService, getSettings } from "@/app/actions"; import Navbar from "@/components/Navbar"; import Footer from "@/components/Footer"; import Image from "next/image"; import Link from "next/link"; import { ArrowRight, CheckCircle2 } from "lucide-react"; import { Metadata } from "next"; import { notFound } from "next/navigation"; interface Props { params: Promise<{ slug: string; location: string; }>; } export async function generateMetadata({ params }: Props): Promise { const { slug, location: locationSlug } = await params; const [service, location] = await Promise.all([ getServiceBySlug(slug), getLocationBySlug(locationSlug) ]); if (!service || !location) return {}; const title = `${location.name} ${service.title} | Muğla Dijital`; const description = `${location.name} bölgesinde profesyonel ${service.title.toLowerCase()} hizmetleri. Muğla Dijital Medya Ajansı ile markanızı zirveye taşıyın.`; return { title, description, alternates: { canonical: `/services/${slug}/${locationSlug}`, } }; } export default async function ServiceLocationPage({ params }: Props) { const { slug, location: locationSlug } = await params; // Vercel Best Practice: async-parallel - Fetch independent operations in parallel const service = await getServiceBySlug(slug); if (!service) notFound(); const [location, settings, projects] = await Promise.all([ getLocationBySlug(locationSlug), getSettings(), getProjectsByService(service.title) ]); if (!location) { notFound(); } const breadcrumbLd = { "@context": "https://schema.org", "@type": "BreadcrumbList", "itemListElement": [ { "@type": "ListItem", "position": 1, "name": "Ana Sayfa", "item": "https://mugladijitalmedya.com" }, { "@type": "ListItem", "position": 2, "name": "Hizmetlerimiz", "item": "https://mugladijitalmedya.com/services" }, { "@type": "ListItem", "position": 3, "name": service.title, "item": `https://mugladijitalmedya.com/services/${service.slug}` }, { "@type": "ListItem", "position": 4, "name": location.name, "item": `https://mugladijitalmedya.com/services/${service.slug}/${location.slug}` } ] }; const serviceLd = { "@context": "https://schema.org", "@type": "Service", "serviceType": service.title, "provider": { "@type": "Organization", "name": "Muğla Dijital", "url": "https://mugladijitalmedya.com" }, "areaServed": { "@type": "City", "name": location.name }, "description": `${location.name} bölgesinde profesyonel ${service.title.toLowerCase()} çözümleri.`, "offers": { "@type": "Offer", "availability": "https://schema.org/InStock", "areaServed": location.name } }; return (