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

export type EditorFormRadioPanelMessages = {
  sectionTitle: string;

  // Group title & option configuration
  groupTitleTypeLabel: string;
  groupTitleTypeOptionText: string;
  groupTitleTypeOptionImage: string;

  groupTitleDisplayLabel: string;
  groupTitleDisplayOptionVisible: string;
  groupTitleDisplayOptionHidden: string;

  layoutLabel: string;
  layoutOptionStacked: string;
  layoutOptionInline: string;

  optionLayoutLabel: string;
  optionLayoutOptionStacked: string;
  optionLayoutOptionInline: string;

  labelGapLabel: string;

  groupTitleLabel: string;

  submitKeyLabel: string;

  optionsLabel: string;
  addOptionButtonLabel: string;
  optionLabelPlaceholder: string;
  optionValuePlaceholder: string;

  optionImageSourceLabel: string;
  optionImageSourceOptionUrl: string;
  optionImageSourceOptionUpload: string;

  optionImageUrlPlaceholder: string;
  optionImageUploadLabel: string;
  optionImageUploadAria: string;

  groupTitleImageSourceLabel: string;
  groupTitleImageSourceOptionUrl: string;
  groupTitleImageSourceOptionUpload: string;

  groupTitleImageUrlLabel: string;
  groupTitleImageUploadLabel: string;
  groupTitleImageUploadAria: string;

  requiredNoticeText: string;

  styleSectionTitle: string;

  textSizeLabel: string;
  textSizeUnitLabel: string;

  lineHeightLabel: string;
  lineHeightUnitLabel: string;

  letterSpacingLabel: string;
  letterSpacingUnitLabel: string;

  fixedWidthLabel: string;
  fixedWidthUnitLabel: string;

  paddingXLabel: string;
  paddingXUnitLabel: string;

  paddingYLabel: string;
  paddingYUnitLabel: string;

  optionGapLabel: string;
  optionGapUnitLabel: string;

  textColorLabel: string;
  textColorPickerAria: string;
  textColorHexAria: string;

  fillColorLabel: string;
  fillColorPickerAria: string;
  fillColorHexAria: string;

  strokeColorLabel: string;
  strokeColorPickerAria: string;
  strokeColorHexAria: string;

  borderRadiusLabel: string;
  borderRadiusPresetNone: string;
  borderRadiusPresetSmall: string;
  borderRadiusPresetMedium: string;
  borderRadiusPresetLarge: string;
  borderRadiusPresetFull: string;
};

const EDITOR_FORM_RADIO_PANEL_MESSAGES: Record<AppLocale, EditorFormRadioPanelMessages> = {
  en: {
    sectionTitle: "Radio field",

    groupTitleTypeLabel: "Group title type",
    groupTitleTypeOptionText: "Text",
    groupTitleTypeOptionImage: "Image",

    groupTitleDisplayLabel: "Group title display mode",
    groupTitleDisplayOptionVisible: "Visible (default)",
    groupTitleDisplayOptionHidden: "Hidden",

    layoutLabel: "Group title layout",
    layoutOptionStacked: "Vertical (default)",
    layoutOptionInline: "Horizontal (inline)",

    optionLayoutLabel: "Option layout",
    optionLayoutOptionStacked: "Vertical (default)",
    optionLayoutOptionInline: "Horizontal (inline)",

    labelGapLabel: "Label/field gap",

    groupTitleLabel: "Group title",

    submitKeyLabel: "Submit key",

    optionsLabel: "Options",
    addOptionButtonLabel: "Add option",
    optionLabelPlaceholder: "Label",
    optionValuePlaceholder: "Value (value)",

    optionImageSourceLabel: "Option image source",
    optionImageSourceOptionUrl: "URL",
    optionImageSourceOptionUpload: "File upload",

    optionImageUrlPlaceholder: "Option image URL (optional)",
    optionImageUploadLabel: "Option image file upload",
    optionImageUploadAria: "Option image file upload",

    groupTitleImageSourceLabel: "Group title image source",
    groupTitleImageSourceOptionUrl: "URL",
    groupTitleImageSourceOptionUpload: "File upload",

    groupTitleImageUrlLabel: "Group title image URL",
    groupTitleImageUploadLabel: "Group title image file upload",
    groupTitleImageUploadAria: "Group title image file upload",

    requiredNoticeText: "Required state is configured in the form controller.",

    styleSectionTitle: "Field style",

    textSizeLabel: "Radio text size",
    textSizeUnitLabel: "(px)",

    lineHeightLabel: "Radio line height",
    lineHeightUnitLabel: "(px)",

    letterSpacingLabel: "Radio letter spacing",
    letterSpacingUnitLabel: "(px)",

    fixedWidthLabel: "Field fixed width",
    fixedWidthUnitLabel: "(px)",

    paddingXLabel: "Radio horizontal padding",
    paddingXUnitLabel: "(px)",

    paddingYLabel: "Radio vertical padding",
    paddingYUnitLabel: "(px)",

    optionGapLabel: "Radio option gap",
    optionGapUnitLabel: "(px)",

    textColorLabel: "Text color",
    textColorPickerAria: "Radio text color picker",
    textColorHexAria: "Radio text color HEX",

    fillColorLabel: "Background color",
    fillColorPickerAria: "Radio background color picker",
    fillColorHexAria: "Radio background color HEX",

    strokeColorLabel: "Border color",
    strokeColorPickerAria: "Radio border color picker",
    strokeColorHexAria: "Radio border color HEX",

    borderRadiusLabel: "Field border radius",
    borderRadiusPresetNone: "None",
    borderRadiusPresetSmall: "Small",
    borderRadiusPresetMedium: "Medium",
    borderRadiusPresetLarge: "Large",
    borderRadiusPresetFull: "Fully rounded",
  },
  ko: {
    sectionTitle: "라디오 필드",

    groupTitleTypeLabel: "그룹 타이틀 타입",
    groupTitleTypeOptionText: "텍스트",
    groupTitleTypeOptionImage: "이미지",

    groupTitleDisplayLabel: "그룹 타이틀 표시 방식",
    groupTitleDisplayOptionVisible: "표시 (기본)",
    groupTitleDisplayOptionHidden: "숨김",

    layoutLabel: "그룹 타이틀 레이아웃",
    layoutOptionStacked: "세로 (기본)",
    layoutOptionInline: "가로 (인라인)",

    optionLayoutLabel: "옵션 레이아웃",
    optionLayoutOptionStacked: "세로 (기본)",
    optionLayoutOptionInline: "가로 (인라인)",

    labelGapLabel: "라벨/필드 간격",

    groupTitleLabel: "그룹 타이틀",

    submitKeyLabel: "전송 키",

    optionsLabel: "옵션",
    addOptionButtonLabel: "옵션 추가",
    optionLabelPlaceholder: "라벨",
    optionValuePlaceholder: "값(value)",

    optionImageSourceLabel: "옵션 이미지 소스",
    optionImageSourceOptionUrl: "URL",
    optionImageSourceOptionUpload: "파일 업로드",

    optionImageUrlPlaceholder: "옵션 이미지 URL (선택)",
    optionImageUploadLabel: "옵션 이미지 파일 업로드",
    optionImageUploadAria: "옵션 이미지 파일 업로드",

    groupTitleImageSourceLabel: "그룹 타이틀 이미지 소스",
    groupTitleImageSourceOptionUrl: "URL",
    groupTitleImageSourceOptionUpload: "파일 업로드",

    groupTitleImageUrlLabel: "그룹 타이틀 이미지 URL",
    groupTitleImageUploadLabel: "그룹 타이틀 이미지 파일 업로드",
    groupTitleImageUploadAria: "그룹 타이틀 이미지 파일 업로드",

    requiredNoticeText: "필수 여부는 폼 컨트롤러에서 설정합니다.",

    styleSectionTitle: "필드 스타일",

    textSizeLabel: "라디오 텍스트 크기",
    textSizeUnitLabel: "(px)",

    lineHeightLabel: "라디오 줄간격",
    lineHeightUnitLabel: "(px)",

    letterSpacingLabel: "라디오 자간",
    letterSpacingUnitLabel: "(px)",

    fixedWidthLabel: "필드 고정 너비",
    fixedWidthUnitLabel: "(px)",

    paddingXLabel: "라디오 가로 패딩",
    paddingXUnitLabel: "(px)",

    paddingYLabel: "라디오 세로 패딩",
    paddingYUnitLabel: "(px)",

    optionGapLabel: "라디오 옵션 간격",
    optionGapUnitLabel: "(px)",

    textColorLabel: "텍스트 색상",
    textColorPickerAria: "라디오 텍스트 색상 피커",
    textColorHexAria: "라디오 텍스트 색상 HEX",

    fillColorLabel: "배경 색상",
    fillColorPickerAria: "라디오 배경 색상 피커",
    fillColorHexAria: "라디오 배경 색상 HEX",

    strokeColorLabel: "테두리 색상",
    strokeColorPickerAria: "라디오 테두리 색상 피커",
    strokeColorHexAria: "라디오 테두리 색상 HEX",

    borderRadiusLabel: "필드 모서리 둥글기",
    borderRadiusPresetNone: "없음",
    borderRadiusPresetSmall: "작게",
    borderRadiusPresetMedium: "보통",
    borderRadiusPresetLarge: "크게",
    borderRadiusPresetFull: "완전 둥글게",
  },
};

export function getEditorFormRadioPanelMessages(locale: AppLocale | null | undefined): EditorFormRadioPanelMessages {
  const key = (locale ?? DEFAULT_LOCALE) as AppLocale;
  return EDITOR_FORM_RADIO_PANEL_MESSAGES[key] ?? EDITOR_FORM_RADIO_PANEL_MESSAGES[DEFAULT_LOCALE];
}
