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

export type PreviewMessages = {
  headerTitle: string;
  headerDescription: string;
  exportZipButtonLabel: string;
  navProjects: string;
  navBackToEditor: string;
};

const PREVIEW_MESSAGES: Record<AppLocale, PreviewMessages> = {
  en: {
    headerTitle: "Page Preview",
    headerDescription: "Preview of the page built with the visual editor.",
    exportZipButtonLabel: "Export as page files (ZIP)",
    navProjects: "Projects",
    navBackToEditor: "Back to editor",
  },
  ko: {
    headerTitle: "Page Preview",
    headerDescription: "빌더로 만든 페이지를 미리 보는 화면",
    exportZipButtonLabel: "페이지 파일로 내보내기 (ZIP)",
    navProjects: "프로젝트 목록",
    navBackToEditor: "에디터로 돌아가기",
  },
};

export function getPreviewMessages(locale: AppLocale | null | undefined): PreviewMessages {
  const key = (locale ?? DEFAULT_LOCALE) as AppLocale;
  return PREVIEW_MESSAGES[key] ?? PREVIEW_MESSAGES[DEFAULT_LOCALE];
}
