import type { Metadata } from "next";

const BASE_URL = "https://kitebeachakyaka.com.tr";

export function buildMeta(
  lang: string,
  path: string,
  tr: { title: string; description: string },
  en: { title: string; description: string }
): Metadata {
  const isEn = lang === "en";
  return {
    title: isEn ? en.title : tr.title,
    description: isEn ? en.description : tr.description,
    alternates: {
      canonical: `${BASE_URL}/${lang}${path}`,
      languages: {
        "x-default": `${BASE_URL}/tr${path}`,
        tr: `${BASE_URL}/tr${path}`,
        en: `${BASE_URL}/en${path}`,
      },
    },
  };
}
