FPSMS-frontend
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

65 line
1.8 KiB

  1. "use client"
  2. import React from "react";
  3. import dynamic from "next/dynamic";
  4. import { useTranslation } from "node_modules/react-i18next";
  5. const ApexCharts = dynamic(() => import("react-apexcharts"), { ssr: false });
  6. const PendingStorageChart: React.FC = () => {
  7. const { t } = useTranslation();
  8. const percent = 93.75;
  9. const options = {
  10. chart: { type: "donut" as const },
  11. labels: [t("Pending storage"), t("Total storage")],
  12. colors: ["#1976d2", "#e0e0e0"],
  13. dataLabels: { enabled: false },
  14. legend: { position: "bottom" as const },
  15. plotOptions: {
  16. pie: {
  17. donut: {
  18. size: "70%",
  19. labels: {
  20. show: true,
  21. name: { show: false },
  22. value: {
  23. show: true,
  24. fontSize: "32px",
  25. fontWeight: 600,
  26. color: "#1976d2",
  27. formatter: () => `${percent}%`
  28. },
  29. total: { show: false }
  30. }
  31. }
  32. }
  33. },
  34. stroke: { show: true, width: 2, colors: ['#fff'] }
  35. };
  36. return (
  37. <div style={{
  38. border: "1px solid #e0e0e0",
  39. borderRadius: 12,
  40. padding: 24,
  41. background: "#fff",
  42. boxShadow: "0 2px 8px rgba(0,0,0,0.04)"
  43. }}>
  44. <div style={{ fontWeight: 600, fontSize: 18, marginBottom: 12 }}>{t("Pending storage")}</div>
  45. <div style={{ width: 320, height: 320, display: "flex", alignItems: "center", justifyContent: "center", margin: "0 auto" }}>
  46. <ApexCharts
  47. options={options}
  48. series={[15, 1]}
  49. type="donut"
  50. width={280}
  51. height={280}
  52. />
  53. </div>
  54. <div style={{ marginTop: 16, textAlign: "left" }}>
  55. <div>&nbsp;</div> {t("Pending storage")}: 15
  56. <div>{t("Total storage")}: 16</div>
  57. </div>
  58. </div>
  59. );
  60. };
  61. export default PendingStorageChart;