import { formatCoin } from "../../utils/format.js";

export function createDonutOption(items) {
  return {
    animationDuration: 650,
    color: ["#2dd7ef", "#1dc9aa", "#367be8", "#9a9cfb"],
    series: [
      {
        data: items,
        itemStyle: { borderColor: "#062039", borderWidth: 2 },
        label: { show: false },
        radius: ["56%", "82%"],
        type: "pie"
      }
    ],
    tooltip: {
      backgroundColor: "#08243a",
      borderColor: "#1a5f82",
      formatter: ({ name, percent, value }) => `${name}<br/>${formatCoin(value)} · ${percent}%`,
      textStyle: { color: "#e9f6ff" }
    }
  };
}
