|
- // material-ui
- import * as React from 'react';
- import {
- useMediaQuery,
- } from '@mui/material';
- import * as DateUtils from "utils/DateUtils";
- import * as ProofStatus from "utils/statusUtils/ProofStatus";
- import {FiDataGrid} from "components/FiDataGrid";
- import * as FormatUtils from "utils/FormatUtils"
- import {useTheme} from "@emotion/react";
- import {useIntl} from "react-intl";
- import { clickableLink } from 'utils/CommonFunction';
- // ==============================|| EVENT TABLE ||============================== //
-
- export default function ProofTab({rows}) {
- const intl = useIntl();
- const theme = useTheme();
- const isMdOrLg = useMediaQuery(theme.breakpoints.up('md'));
- const { locale } = intl;
-
-
- const columns = [
- {
-
- field: 'actions',
- headerName: intl.formatMessage({id: 'proofId'}),
- width: 200,
- cellClassName: 'actions',
- renderCell: (params) => {
- return clickableLink('/proof/reply/' + params.row.id, params.row.refNo);
- },
- },
- {
- id: 'actions',
- headerName: intl.formatMessage({id: 'status'}),
- width: isMdOrLg ? 'auto' : 160,
- flex: isMdOrLg ? 1 : undefined,
- renderCell: (params) => {
- return locale === 'en' ? ProofStatus.getStatus_Eng(params) : ProofStatus.getStatus_Cht(params);
- },
- },
- {
- id: 'created',
- field: 'created',
- headerName: intl.formatMessage({id: 'proofDate'}),
- width: isMdOrLg ? 'auto' : 160,
- flex: isMdOrLg ? 1 : undefined,
- valueGetter: (params) => {
- return DateUtils.datetimeStr(params?.value);
- }
- },
- {
- id: 'replyDate',
- field: 'replyDate',
- headerName: intl.formatMessage({id: 'replyDate'}),
- width: isMdOrLg ? 'auto' : 160,
- flex: isMdOrLg ? 1 : undefined,
- valueGetter: (params) => {
- return params?.value?DateUtils.datetimeStr(params?.value):"";
- }
- },
- {
- id: 'fee',
- field: 'fee',
- headerName: intl.formatMessage({id: 'fee'}),
- width: isMdOrLg ? 'auto' : 160,
- flex: isMdOrLg ? 1 : undefined,
- valueGetter: (params) => {
- return (params?.value)?"$ "+FormatUtils.currencyFormat(params?.value):"";
- }
- },
- ];
-
- return (
- <div style={{height:'20%', width: '100%'}}>
- <FiDataGrid
- rows={rows}
- columns={columns}
- customPageSize={5}
- />
- </div>
- );
- }
|