import type { AppLocale } from "../locale";
import { DEFAULT_LOCALE } from "../locale";

export type EditorProjectPropertiesPanelMessages = {
  sectionTitle: string;

  projectTitleLabel: string;
  projectTitleAria: string;

  projectSlugLabel: string;
  projectSlugAria: string;

  canvasWidthLabel: string;
  canvasWidthUnitLabel: string;
  canvasWidthPresetMobile: string;
  canvasWidthPresetTablet: string;
  canvasWidthPresetDesktop: string;

  canvasBgLabel: string;
  canvasBgColorAria: string;
  canvasBgHexAria: string;

  pageBgLabel: string;
  pageBgColorAria: string;
  pageBgHexAria: string;

  seoSectionTitle: string;

  seoTitleLabel: string;
  seoTitleAria: string;
  seoTitlePlaceholderFallback: string;

  seoDescriptionLabel: string;
  seoDescriptionAria: string;
  seoDescriptionPlaceholder: string;

  seoOgImageUrlLabel: string;
  seoOgImageUrlAria: string;
  seoOgImageUrlPlaceholder: string;

  seoCanonicalUrlLabel: string;
  seoCanonicalUrlAria: string;
  seoCanonicalUrlPlaceholder: string;

  seoNoIndexAria: string;
  seoNoIndexLabel: string;

  headHtmlLabel: string;
  headHtmlAria: string;
  headHtmlPlaceholder: string;

  trackingScriptLabel: string;
  trackingScriptAria: string;
  trackingScriptPlaceholder: string;
};

const EDITOR_PROJECT_PROPERTIES_PANEL_MESSAGES: Record<AppLocale, EditorProjectPropertiesPanelMessages> = {
  en: {
    sectionTitle: "Project settings",

    projectTitleLabel: "Project title",
    projectTitleAria: "Project title",

    projectSlugLabel: "Project slug",
    projectSlugAria: "Project slug",

    canvasWidthLabel: "Canvas width",
    canvasWidthUnitLabel: "(px)",
    canvasWidthPresetMobile: "Mobile (390px)",
    canvasWidthPresetTablet: "Tablet (768px)",
    canvasWidthPresetDesktop: "Desktop (1200px)",

    canvasBgLabel: "Canvas background color",
    canvasBgColorAria: "Canvas background color",
    canvasBgHexAria: "Canvas background HEX",

    pageBgLabel: "Page background color",
    pageBgColorAria: "Page background color",
    pageBgHexAria: "Page background HEX",

    seoSectionTitle: "SEO / meta",

    seoTitleLabel: "SEO title",
    seoTitleAria: "SEO title",
    seoTitlePlaceholderFallback: "Page title",

    seoDescriptionLabel: "Meta description",
    seoDescriptionAria: "Meta description",
    seoDescriptionPlaceholder: "Enter a description for search engines and social sharing.",

    seoOgImageUrlLabel: "OG/Twitter image URL",
    seoOgImageUrlAria: "OG/Twitter image URL",
    seoOgImageUrlPlaceholder: "e.g. https://example.com/og-image.png",

    seoCanonicalUrlLabel: "Canonical URL",
    seoCanonicalUrlAria: "Canonical URL",
    seoCanonicalUrlPlaceholder: "e.g. https://example.com/landing",

    seoNoIndexAria: "Hide from search engines (noindex)",
    seoNoIndexLabel: "Hide from search engines (noindex)",

    headHtmlLabel: "Page head HTML",
    headHtmlAria: "Page head HTML",
    headHtmlPlaceholder: 'e.g. <meta name="description" content="..." />',

    trackingScriptLabel: "Tracking script",
    trackingScriptAria: "Tracking script",
    trackingScriptPlaceholder: 'e.g. <script>/* GA, Pixel code */</script>',
  },

  ko: {
    sectionTitle: "프로젝트 설정",

    projectTitleLabel: "프로젝트 제목",
    projectTitleAria: "프로젝트 제목",

    projectSlugLabel: "프로젝트 주소 (slug)",
    projectSlugAria: "프로젝트 주소 (slug)",

    canvasWidthLabel: "캔버스 너비",
    canvasWidthUnitLabel: "(px)",
    canvasWidthPresetMobile: "모바일 (390px)",
    canvasWidthPresetTablet: "태블릿 (768px)",
    canvasWidthPresetDesktop: "데스크톱 (1200px)",

    canvasBgLabel: "캔버스 배경색",
    canvasBgColorAria: "캔버스 배경색",
    canvasBgHexAria: "캔버스 배경색 HEX",

    pageBgLabel: "페이지 배경색",
    pageBgColorAria: "페이지 배경색",
    pageBgHexAria: "페이지 배경색 HEX",

    seoSectionTitle: "SEO / 메타",

    seoTitleLabel: "SEO 타이틀",
    seoTitleAria: "SEO 타이틀",
    seoTitlePlaceholderFallback: "페이지 제목",

    seoDescriptionLabel: "메타 디스크립션",
    seoDescriptionAria: "메타 디스크립션",
    seoDescriptionPlaceholder: "검색엔진 및 SNS 공유에 노출될 페이지 설명을 입력하세요.",

    seoOgImageUrlLabel: "OG/Twitter 이미지 URL",
    seoOgImageUrlAria: "OG/Twitter 이미지 URL",
    seoOgImageUrlPlaceholder: "예: https://example.com/og-image.png",

    seoCanonicalUrlLabel: "Canonical URL",
    seoCanonicalUrlAria: "Canonical URL",
    seoCanonicalUrlPlaceholder: "예: https://example.com/landing",

    seoNoIndexAria: "검색 엔진에 노출하지 않기 (noindex)",
    seoNoIndexLabel: "검색 엔진에 노출하지 않기 (noindex)",

    headHtmlLabel: "페이지 head HTML",
    headHtmlAria: "페이지 head HTML",
    headHtmlPlaceholder: '예: <meta name="description" content="..." />',

    trackingScriptLabel: "추적 스크립트",
    trackingScriptAria: "추적 스크립트",
    trackingScriptPlaceholder: '예: <script>/* GA, Pixel 코드 */</script>',
  },
};

export function getEditorProjectPropertiesPanelMessages(
  locale: AppLocale | null | undefined,
): EditorProjectPropertiesPanelMessages {
  const key = (locale ?? DEFAULT_LOCALE) as AppLocale;
  return EDITOR_PROJECT_PROPERTIES_PANEL_MESSAGES[key] ?? EDITOR_PROJECT_PROPERTIES_PANEL_MESSAGES[DEFAULT_LOCALE];
}
