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

export type EditorColorPickerFieldMessages = {
  dropdownLabelDefault: string;
  hexPlaceholder: string;
  paletteLabels: Record<string, string>;
};

const EDITOR_COLOR_PICKER_FIELD_MESSAGES: Record<AppLocale, EditorColorPickerFieldMessages> = {
  en: {
    dropdownLabelDefault: "Color palette",
    hexPlaceholder: "e.g. #ff0000",
    paletteLabels: {
      default: "None",
      transparent: "Transparent",
      muted: "Muted",
      strong: "Strong highlight",
      neutral: "Neutral",
      accent: "Accent",
      "accent-deep": "Accent (deep)",
      "accent-soft": "Accent (soft)",
      danger: "Danger",
      "danger-deep": "Danger (strong)",
      success: "Success",
      "success-soft": "Success (soft)",
      warning: "Warning",
      info: "Info",
      purple: "Purple",
      "purple-soft": "Purple (soft)",
      pink: "Pink",
      "pink-soft": "Pink (soft)",
      dark: "Dark text",
      "dark-muted": "Dark muted",
    },
  },
  ko: {
    dropdownLabelDefault: "색상 팔레트",
    hexPlaceholder: "예: #ff0000",
    paletteLabels: {
      default: "없음",
      transparent: "투명",
      muted: "연한",
      strong: "강조",
      neutral: "중립",
      accent: "포인트",
      "accent-deep": "포인트 진하게",
      "accent-soft": "포인트 연하게",
      danger: "위험",
      "danger-deep": "위험 진하게",
      success: "성공",
      "success-soft": "성공 연하게",
      warning: "경고",
      info: "정보",
      purple: "보라",
      "purple-soft": "연한 보라",
      pink: "핑크",
      "pink-soft": "연한 핑크",
      dark: "어두운 텍스트",
      "dark-muted": "어두운 연한",
    },
  },
};

export function getEditorColorPickerFieldMessages(
  locale: AppLocale | null | undefined,
): EditorColorPickerFieldMessages {
  const key = (locale ?? DEFAULT_LOCALE) as AppLocale;
  return EDITOR_COLOR_PICKER_FIELD_MESSAGES[key] ?? EDITOR_COLOR_PICKER_FIELD_MESSAGES[DEFAULT_LOCALE];
}
