/** 玩法展示名（与种子 play_types 对齐；无映射时回退 play_code） */
const LABELS: Record<string, string> = {
  big: "Big",
  small: "Small",
  pos_4a: "4A",
  pos_4b: "4B",
  pos_4c: "4C",
  pos_4d: "4D",
  pos_4e: "4E",
  pos_3a: "3A",
  pos_3b: "3B",
  pos_3c: "3C",
  pos_3abc: "3ABC",
  pos_2a: "2A",
  pos_2b: "2B",
  pos_2c: "2C",
  pos_2abc: "2ABC",
  straight: "Straight",
  box: "Box",
  ibox: "iBox",
  mbox: "mBox",
  roll: "Roll",
  half_box: "Half Box",
  head: "Head",
  tail: "Tail",
  odd: "Odd",
  even: "Even",
  digit_big: "Big Digit",
  digit_small: "Small Digit",
};

export function playLabelZh(playCode: string): string {
  return LABELS[playCode] ?? playCode;
}

export function playLabel(
  playCode: string,
  t?: (key: string, options?: { defaultValue?: string }) => string,
): string {
  if (!t) {
    return playLabelZh(playCode);
  }
  return t(`playLabels.${playCode}`, { defaultValue: LABELS[playCode] ?? playCode });
}
