import React from 'react';
import { JzljGcxmContext } from "../..";
import { VmFactorList, VmWrapper } from "../../../_components";
import useSettings from "../../../_hooks/useSettings";
import { overviewApis } from "../../api";
import "./index.less";
import overview_czz_zl_dark from "../../imgs/overview_czz_zl_dark.png";
import overview_czz_zl_light from "../../imgs/overview_czz_zl_light.png";
import overview_czz_zs_dark from "../../imgs/overview_czz_zs_dark.png";
import overview_czz_zs_light from "../../imgs/overview_czz_zs_light.png";
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
export default function CZZ(_ref) {
  var unitStr = _ref.unitStr;
  var _React$useContext = React.useContext(JzljGcxmContext),
    id = _React$useContext.id,
    theme = _React$useContext.theme;
  var _useSettings = useSettings(),
    isDark = _useSettings.isDark;
  var _overviewApis$useCzz = overviewApis.useCzz(id),
    data = _overviewApis$useCzz.data;
  var _data$totalCzzCount = data.totalCzzCount,
    totalCzzCount = _data$totalCzzCount === void 0 ? 0 : _data$totalCzzCount,
    _data$sxzCzzCount = data.sxzCzzCount,
    sxzCzzCount = _data$sxzCzzCount === void 0 ? 0 : _data$sxzCzzCount,
    _data$baWeight = data.baWeight,
    baWeight = _data$baWeight === void 0 ? 0 : _data$baWeight,
    _data$yysWeight = data.yysWeight,
    yysWeight = _data$yysWeight === void 0 ? 0 : _data$yysWeight,
    _data$syWeight = data.syWeight,
    syWeight = _data$syWeight === void 0 ? 0 : _data$syWeight;
  var dataList_top = [{
    name: '总数',
    unit: '张',
    value: totalCzzCount,
    img: isDark ? overview_czz_zl_dark : overview_czz_zs_light,
    fontType: 'blue',
    unitStyle: {
      fontSize: 14
    },
    style: {
      flex: 1
    }
  }, {
    name: '总量',
    unit: unitStr,
    value: yysWeight + syWeight,
    img: isDark ? overview_czz_zs_dark : overview_czz_zl_light,
    fontType: 'blue',
    unitStyle: {
      fontSize: 14
    },
    style: {
      flex: 1.5
    }
  }];
  var dataList_bahz = [{
    name: '备案量',
    unit: unitStr,
    value: baWeight,
    unitStyle: {
      fontSize: 14
    },
    style: {
      flex: 1,
      justifyContent: 'center',
      textAlign: 'center'
    }
  }, {
    name: '核准量',
    unit: unitStr,
    value: 0,
    unitStyle: {
      fontSize: 14
    },
    style: {
      flex: 1,
      justifyContent: 'center',
      textAlign: 'center'
    }
  }];
  var dataList_yssy = [{
    name: '已运输量',
    unit: unitStr,
    value: yysWeight,
    unitStyle: {
      fontSize: 14
    },
    style: {
      flex: 1,
      justifyContent: 'center',
      textAlign: 'center'
    }
  }, {
    name: '剩余量',
    unit: unitStr,
    value: syWeight,
    unitStyle: {
      fontSize: 14
    },
    style: {
      flex: 1,
      justifyContent: 'center',
      textAlign: 'center'
    }
  }];
  return /*#__PURE__*/_jsx("div", {
    className: "overview-right-top-left ".concat(theme),
    children: /*#__PURE__*/_jsx(VmWrapper, {
      title: "\u5904\u7F6E\u8BC1\u4FE1\u606F",
      children: /*#__PURE__*/_jsxs("div", {
        className: "overview-right-top-left-czz",
        children: [/*#__PURE__*/_jsx("div", {
          className: "overview-right-top-left-czz-top",
          children: /*#__PURE__*/_jsx(VmFactorList, {
            list: dataList_top
          })
        }), /*#__PURE__*/_jsx(VmFactorList, {
          list: dataList_bahz,
          style: {
            background: 'unset'
          }
        }), /*#__PURE__*/_jsx(VmFactorList, {
          list: dataList_yssy,
          style: {
            background: 'unset'
          }
        })]
      })
    })
  });
}