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

export type EditorFormSelectPanelMessages = {
  sectionTitle: string;

  labelTypeLabel: string;
  labelTypeOptionText: string;
  labelTypeOptionImage: string;

  labelDisplayLabel: string;
  labelDisplayOptionVisible: string;
  labelDisplayOptionHidden: string;

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

  labelGapLabel: string;

  fieldLabelLabel: string;
  submitKeyLabel: string;

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

  requiredNoticeText: string;

  styleSectionTitle: string;

  textSizeLabel: string;
  textSizeUnitLabel: string;

  lineHeightLabel: string;
  lineHeightUnitLabel: string;

  letterSpacingLabel: string;
  letterSpacingUnitLabel: string;

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

  fixedWidthLabel: string;
  fixedWidthUnitLabel: string;

  paddingXLabel: string;
  paddingXUnitLabel: string;

  paddingYLabel: string;
  paddingYUnitLabel: 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_SELECT_PANEL_MESSAGES: Record<AppLocale, EditorFormSelectPanelMessages> = {
  en: {
    sectionTitle: "Select field",

    labelTypeLabel: "Label type",
    labelTypeOptionText: "Text",
    labelTypeOptionImage: "Image",

    labelDisplayLabel: "Label display mode",
    labelDisplayOptionVisible: "Visible (default)",
    labelDisplayOptionHidden: "Hidden",

    layoutLabel: "Layout",
    layoutOptionStacked: "Vertical (default)",
    layoutOptionInline: "Horizontal (inline)",

    labelGapLabel: "Label/field gap",

    fieldLabelLabel: "Field label",
    submitKeyLabel: "Submit key",

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

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

    styleSectionTitle: "Field style",

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

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

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

    widthModeLabel: "Field width",
    widthModeOptionAuto: "Auto",
    widthModeOptionFull: "Full width",
    widthModeOptionFixed: "Fixed value",

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

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

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

    textColorLabel: "Field text color",
    textColorPickerAria: "Select text color picker",
    textColorHexAria: "Select text color HEX",

    fillColorLabel: "Field fill color",
    fillColorPickerAria: "Select fill color picker",
    fillColorHexAria: "Select fill color HEX",

    strokeColorLabel: "Field border color",
    strokeColorPickerAria: "Select border color picker",
    strokeColorHexAria: "Select border color HEX",

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

    labelTypeLabel: "라벨 타입",
    labelTypeOptionText: "텍스트",
    labelTypeOptionImage: "이미지",

    labelDisplayLabel: "라벨 표시 방식",
    labelDisplayOptionVisible: "표시 (기본)",
    labelDisplayOptionHidden: "숨김",

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

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

    fieldLabelLabel: "필드 라벨",
    submitKeyLabel: "전송 키",

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

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

    styleSectionTitle: "필드 스타일",

    textSizeLabel: "셀렉트 텍스트 크기",
    textSizeUnitLabel: "(px)",

    lineHeightLabel: "셀렉트 줄간격",
    lineHeightUnitLabel: "(px)",

    letterSpacingLabel: "셀렉트 자간",
    letterSpacingUnitLabel: "(px)",

    widthModeLabel: "필드 너비",
    widthModeOptionAuto: "자동",
    widthModeOptionFull: "전체 폭",
    widthModeOptionFixed: "고정 값",

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

    paddingXLabel: "셀렉트 가로 패딩",
    paddingXUnitLabel: "(px)",

    paddingYLabel: "셀렉트 세로 패딩",
    paddingYUnitLabel: "(px)",

    textColorLabel: "필드 텍스트 색상",
    textColorPickerAria: "셀렉트 텍스트 색상 피커",
    textColorHexAria: "셀렉트 텍스트 색상 HEX",

    fillColorLabel: "필드 채움 색상",
    fillColorPickerAria: "셀렉트 채움 색상 피커",
    fillColorHexAria: "셀렉트 채움 색상 HEX",

    strokeColorLabel: "필드 테두리 색상",
    strokeColorPickerAria: "셀렉트 테두리 색상 피커",
    strokeColorHexAria: "셀렉트 테두리 색상 HEX",

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

export function getEditorFormSelectPanelMessages(
  locale: AppLocale | null | undefined,
): EditorFormSelectPanelMessages {
  const key = (locale ?? DEFAULT_LOCALE) as AppLocale;
  return EDITOR_FORM_SELECT_PANEL_MESSAGES[key] ?? EDITOR_FORM_SELECT_PANEL_MESSAGES[DEFAULT_LOCALE];
}
