type nameString =
  | "Rapid"
  | "LTDEXP"
  | "NightLTDEXP"
  | "SPCL"
  | "Normal"
  | string;
type colorString = "aqua" | "red" | "blue" | "white";
type trainTypeString =
  | "快速"
  | "特急"
  | "寝台特急"
  | "臨時"
  | "普通列車"
  | "普通列車(ワンマン)"
  | "その他";
type trainTypeDataString = "rapid" | "express" | "normal";
type getTrainType = (d: nameString) => {
  color: colorString;
  name: trainTypeString;
  data: trainTypeDataString;
};
export const getTrainType: getTrainType = (nameString) => {
  switch (nameString) {
    case "Rapid":
      return { color: "aqua", name: "快速", data: "rapid" };
    case "LTDEXP":
      return { color: "red", name: "特急", data: "express" };
    case "NightLTDEXP":
      return { color: "red", name: "寝台特急", data: "express" };
    case "SPCL":
      return { color: "blue", name: "臨時", data: "normal" };
    case "OneMan":
      return { color: "white", name: "普通列車(ワンマン)", data: "normal" };
    case "Normal":
      return { color: "white", name: "普通列車", data: "normal" };
    default:
      return { color: "white", name: "その他", data: "normal" };
  }
};
