Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 

84 řádky
2.7 KiB

  1. // material-ui
  2. import * as React from 'react';
  3. import {
  4. useMediaQuery,
  5. } from '@mui/material';
  6. import * as DateUtils from "utils/DateUtils";
  7. import * as ProofStatus from "utils/statusUtils/ProofStatus";
  8. import {FiDataGrid} from "components/FiDataGrid";
  9. import * as FormatUtils from "utils/FormatUtils"
  10. import {useTheme} from "@emotion/react";
  11. import {useIntl} from "react-intl";
  12. import { clickableLink } from 'utils/CommonFunction';
  13. // ==============================|| EVENT TABLE ||============================== //
  14. export default function ProofTab({rows}) {
  15. const intl = useIntl();
  16. const theme = useTheme();
  17. const isMdOrLg = useMediaQuery(theme.breakpoints.up('md'));
  18. const { locale } = intl;
  19. const columns = [
  20. {
  21. field: 'actions',
  22. headerName: intl.formatMessage({id: 'proofId'}),
  23. width: 200,
  24. cellClassName: 'actions',
  25. renderCell: (params) => {
  26. return clickableLink('/proof/reply/' + params.row.id, params.row.refNo);
  27. },
  28. },
  29. {
  30. id: 'actions',
  31. headerName: intl.formatMessage({id: 'status'}),
  32. width: isMdOrLg ? 'auto' : 160,
  33. flex: isMdOrLg ? 1 : undefined,
  34. renderCell: (params) => {
  35. return locale === 'en' ? ProofStatus.getStatus_Eng(params) : ProofStatus.getStatus_Cht(params);
  36. },
  37. },
  38. {
  39. id: 'created',
  40. field: 'created',
  41. headerName: intl.formatMessage({id: 'proofDate'}),
  42. width: isMdOrLg ? 'auto' : 160,
  43. flex: isMdOrLg ? 1 : undefined,
  44. valueGetter: (params) => {
  45. return DateUtils.datetimeStr(params?.value);
  46. }
  47. },
  48. {
  49. id: 'replyDate',
  50. field: 'replyDate',
  51. headerName: intl.formatMessage({id: 'replyDate'}),
  52. width: isMdOrLg ? 'auto' : 160,
  53. flex: isMdOrLg ? 1 : undefined,
  54. valueGetter: (params) => {
  55. return params?.value?DateUtils.datetimeStr(params?.value):"";
  56. }
  57. },
  58. {
  59. id: 'fee',
  60. field: 'fee',
  61. headerName: intl.formatMessage({id: 'fee'}),
  62. width: isMdOrLg ? 'auto' : 160,
  63. flex: isMdOrLg ? 1 : undefined,
  64. valueGetter: (params) => {
  65. return (params?.value)?"$ "+FormatUtils.currencyFormat(params?.value):"";
  66. }
  67. },
  68. ];
  69. return (
  70. <div style={{height:'20%', width: '100%'}}>
  71. <FiDataGrid
  72. rows={rows}
  73. columns={columns}
  74. customPageSize={5}
  75. />
  76. </div>
  77. );
  78. }