FPSMS-frontend
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

ApplicationCompletionChart.tsx 3.5 KiB

6 mesi fa
6 mesi fa
6 mesi fa
6 mesi fa
6 mesi fa
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. "use client";
  2. import React, { useState } from "react";
  3. import SafeApexCharts from "@/components/charts/SafeApexCharts";
  4. import { useTranslation } from "react-i18next";
  5. const ApplicationCompletionChart: React.FC = () => {
  6. const { t } = useTranslation();
  7. const [tab, setTab] = useState(t("Store Management"));
  8. const percent = 0;
  9. const options = {
  10. chart: { type: "donut" as const },
  11. labels: [],
  12. colors: ["#42A5F5", "#e0e0e0"],
  13. dataLabels: {
  14. enabled: true,
  15. formatter: () => `${percent}%`,
  16. style: { fontSize: "32px", fontWeight: 600, color: "#1976d2" },
  17. },
  18. legend: { show: false },
  19. plotOptions: {
  20. pie: {
  21. donut: {
  22. size: "70%",
  23. labels: {
  24. show: false,
  25. },
  26. },
  27. },
  28. },
  29. stroke: { show: true, width: 2, colors: ["#fff"] },
  30. };
  31. return (
  32. <div
  33. style={{
  34. border: "1px solid #e0e0e0",
  35. borderRadius: 12,
  36. padding: 24,
  37. background: "#fff",
  38. boxShadow: "0 2px 8px rgba(0,0,0,0.04)",
  39. display: "flex",
  40. flexDirection: "column",
  41. alignItems: "center",
  42. }}
  43. >
  44. <div
  45. style={{
  46. width: "100%",
  47. fontWeight: 600,
  48. fontSize: 18,
  49. marginBottom: 12,
  50. display: "flex",
  51. alignItems: "center",
  52. }}
  53. >
  54. <span
  55. style={{
  56. flex: 1,
  57. whiteSpace: "nowrap",
  58. overflow: "hidden",
  59. textOverflow: "ellipsis",
  60. textAlign: "left",
  61. }}
  62. >
  63. {t("Application completion")}
  64. </span>
  65. <div>
  66. <button
  67. style={{
  68. border:
  69. tab === t("Raw MA")
  70. ? "1px solid #1976d2"
  71. : "1px solid #e0e0e0",
  72. background: tab === t("Store Management") ? "#fff" : "#f5f5f5",
  73. color: tab === t("Store Management") ? "#1976d2" : "#333",
  74. borderRadius: 4,
  75. padding: "2px 12px",
  76. marginRight: 4,
  77. cursor: "pointer",
  78. }}
  79. onClick={() => setTab(t("Store Management"))}
  80. >
  81. {t("Store Management")}
  82. </button>
  83. <button
  84. style={{
  85. border:
  86. tab === t("Shipment")
  87. ? "1px solid #1976d2"
  88. : "1px solid #e0e0e0",
  89. background: tab === t("Shipment") ? "#fff" : "#f5f5f5",
  90. color: tab === t("Shipment") ? "#1976d2" : "#333",
  91. borderRadius: 4,
  92. padding: "2px 12px",
  93. cursor: "pointer",
  94. }}
  95. onClick={() => setTab(t("Shipment"))}
  96. >
  97. {t("Shipment")}
  98. </button>
  99. </div>
  100. </div>
  101. <div
  102. style={{
  103. width: "100%",
  104. height: 320,
  105. display: "flex",
  106. alignItems: "center",
  107. justifyContent: "center",
  108. margin: "0 auto",
  109. }}
  110. >
  111. <SafeApexCharts
  112. options={options}
  113. series={[0, 100]}
  114. type="donut"
  115. width="100%"
  116. height={280}
  117. />
  118. </div>
  119. <div
  120. style={{
  121. marginTop: 16,
  122. textAlign: "left",
  123. border: "1px solid #e0e0e0",
  124. borderRadius: 8,
  125. padding: 12,
  126. background: "#fafafa",
  127. }}
  128. >
  129. <div>{t("Processed application")}: 0</div>
  130. <div>{t("Pending application")}: 0</div>
  131. </div>
  132. </div>
  133. );
  134. };
  135. export default ApplicationCompletionChart;