Quota.tsx 502 B

123456789101112131415161718192021
  1. import React from 'react';
  2. import { Statistic } from 'antd';
  3. import { useSelector } from 'react-redux';
  4. import { RootState } from '../../states/store';
  5. const Quota: React.FC = () => {
  6. const availableQuota = useSelector(
  7. (state: RootState) => state.quota.available
  8. );
  9. const totalQuota = useSelector((state: RootState) => state.quota.total);
  10. return (
  11. <Statistic
  12. title="可用额"
  13. value={availableQuota}
  14. suffix={`/ ${totalQuota}`}
  15. />
  16. );
  17. };
  18. export default Quota;