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

export type EditorVideoPanelMessages = {
  sourceLabel: string;
  sourceAria: string;
  sourceOptionUrl: string;
  sourceOptionUpload: string;

  urlLabel: string;
  urlAria: string;

  titleLabel: string;
  titleAria: string;

  ariaLabelLabel: string;
  ariaLabelAria: string;

  captionTextLabel: string;
  captionTextAria: string;

  posterImageUrlLabel: string;
  posterImageUrlAria: string;

  uploadLabel: string;
  uploadAria: string;

  styleSectionTitle: string;

  cardBackgroundLabel: string;
  cardBackgroundPickerAria: string;
  cardBackgroundHexAria: string;

  alignLabel: string;
  alignAria: string;
  alignOptionLeft: string;
  alignOptionCenter: string;
  alignOptionRight: string;

  widthModeLabel: string;
  widthModeAria: string;
  widthModeOptionAuto: string;
  widthModeOptionFull: string;
  widthModeOptionFixed: string;

  fixedWidthLabel: string;
  fixedWidthUnitLabel: string;
  fixedWidthPresetSmall: string;
  fixedWidthPresetMedium: string;
  fixedWidthPresetLarge: string;

  cardPaddingLabel: string;
  cardPaddingUnitLabel: string;

  cardBorderRadiusLabel: string;
  cardBorderRadiusUnitLabel: string;

  startTimeLabel: string;
  startTimeUnitLabel: string;

  endTimeLabel: string;
  endTimeUnitLabel: string;

  aspectRatioLabel: string;
  aspectRatioAria: string;

  autoplayLabel: string;
  loopLabel: string;
  mutedLabel: string;
  controlsLabel: string;
};

const EDITOR_VIDEO_PANEL_MESSAGES: Record<AppLocale, EditorVideoPanelMessages> = {
  en: {
    sourceLabel: "Video source",
    sourceAria: "Video source",
    sourceOptionUrl: "URL",
    sourceOptionUpload: "File upload",

    urlLabel: "Video URL",
    urlAria: "Video URL",

    titleLabel: "Video title",
    titleAria: "Video title",

    ariaLabelLabel: "Video aria-label",
    ariaLabelAria: "Video aria-label",

    captionTextLabel: "Video caption text",
    captionTextAria: "Video caption text",

    posterImageUrlLabel: "Poster image URL",
    posterImageUrlAria: "Poster image URL",

    uploadLabel: "Video file upload",
    uploadAria: "Video file upload",

    styleSectionTitle: "Video style",

    cardBackgroundLabel: "Card background color",
    cardBackgroundPickerAria: "Video card background color picker",
    cardBackgroundHexAria: "Video card background color HEX",

    alignLabel: "Video alignment",
    alignAria: "Video alignment",
    alignOptionLeft: "Left",
    alignOptionCenter: "Center",
    alignOptionRight: "Right",

    widthModeLabel: "Video width mode",
    widthModeAria: "Video width mode",
    widthModeOptionAuto: "Fit to content",
    widthModeOptionFull: "Full width",
    widthModeOptionFixed: "Fixed width",

    fixedWidthLabel: "Fixed width",
    fixedWidthUnitLabel: "(px)",
    fixedWidthPresetSmall: "Small",
    fixedWidthPresetMedium: "Medium",
    fixedWidthPresetLarge: "Wide",

    cardPaddingLabel: "Card padding",
    cardPaddingUnitLabel: "(px)",

    cardBorderRadiusLabel: "Card border radius",
    cardBorderRadiusUnitLabel: "(px)",

    startTimeLabel: "Start time (sec)",
    startTimeUnitLabel: "(sec)",

    endTimeLabel: "End time (sec)",
    endTimeUnitLabel: "(sec)",

    aspectRatioLabel: "Video aspect ratio",
    aspectRatioAria: "Video aspect ratio",

    autoplayLabel: "Autoplay",
    loopLabel: "Loop",
    mutedLabel: "Muted",
    controlsLabel: "Show controls",
  },
  ko: {
    sourceLabel: "비디오 소스",
    sourceAria: "비디오 소스",
    sourceOptionUrl: "URL",
    sourceOptionUpload: "파일 업로드",

    urlLabel: "비디오 URL",
    urlAria: "비디오 URL",

    titleLabel: "비디오 제목",
    titleAria: "비디오 제목",

    ariaLabelLabel: "비디오 aria-label",
    ariaLabelAria: "비디오 aria-label",

    captionTextLabel: "비디오 캡션 텍스트",
    captionTextAria: "비디오 캡션 텍스트",

    posterImageUrlLabel: "포스터 이미지 URL",
    posterImageUrlAria: "포스터 이미지 URL",

    uploadLabel: "비디오 파일 업로드",
    uploadAria: "비디오 파일 업로드",

    styleSectionTitle: "비디오 스타일",

    cardBackgroundLabel: "카드 배경색",
    cardBackgroundPickerAria: "비디오 카드 배경색 피커",
    cardBackgroundHexAria: "비디오 카드 배경색 HEX",

    alignLabel: "비디오 정렬",
    alignAria: "비디오 정렬",
    alignOptionLeft: "왼쪽",
    alignOptionCenter: "가운데",
    alignOptionRight: "오른쪽",

    widthModeLabel: "비디오 너비 모드",
    widthModeAria: "비디오 너비 모드",
    widthModeOptionAuto: "내용에 맞춤",
    widthModeOptionFull: "가로 전체",
    widthModeOptionFixed: "고정 너비",

    fixedWidthLabel: "고정 너비",
    fixedWidthUnitLabel: "(px)",
    fixedWidthPresetSmall: "작게",
    fixedWidthPresetMedium: "보통",
    fixedWidthPresetLarge: "넓게",

    cardPaddingLabel: "카드 패딩",
    cardPaddingUnitLabel: "(px)",

    cardBorderRadiusLabel: "카드 모서리 둥글기",
    cardBorderRadiusUnitLabel: "(px)",

    startTimeLabel: "시작 시점 (초)",
    startTimeUnitLabel: "(초)",

    endTimeLabel: "종료 시점 (초)",
    endTimeUnitLabel: "(초)",

    aspectRatioLabel: "화면 비율",
    aspectRatioAria: "화면 비율",

    autoplayLabel: "자동 재생",
    loopLabel: "반복 재생",
    mutedLabel: "음소거",
    controlsLabel: "재생 컨트롤 표시",
  },
};

export function getEditorVideoPanelMessages(locale: AppLocale | null | undefined): EditorVideoPanelMessages {
  const key = (locale ?? DEFAULT_LOCALE) as AppLocale;
  return EDITOR_VIDEO_PANEL_MESSAGES[key] ?? EDITOR_VIDEO_PANEL_MESSAGES[DEFAULT_LOCALE];
}
