All files / src/components/Merchants/ViewTransaction ViewTransactionBannerMobile.tsx

0% Statements 0/7
0% Branches 0/8
0% Functions 0/2
0% Lines 0/7

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158                                                                                                                                                                                                                                                                                                                           
// import * as React from "react";
// import { palette } from "@palette";
// mui
import Box from "@mui/material/Box";
import Grid from "@mui/material/Grid";
import { useTheme } from "@mui/material/styles";
// components
import { Text } from "@common/Text";
// localization
// import { useTranslation } from "react-i18next";
// import { namespaces } from "localization/resources/i18n.constants";
// utils
import { toEnFormat } from "@utils/index";
 
const backgroundGradient = {
  position: "absolute",
  borderRadius: "8px",
  height: 324,
  width: 225,
  top: -10,
  left: "calc(50% - 225px/2)",
  transform: "rotate(90deg)",
  transition: "top 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",
  background:
    "linear-gradient(104.33deg, #D0B2DD 25.61%, #b3a1bb 54.5%, #E6B96F 82.41%)",
};
 
const mainContent = {
  gap: "16px",
  display: "flex",
  padding: "16px 24px",
  flexDirection: "column",
  backgroundColor: "rgba(246, 250, 255, 0.8)",
  boxShadow: "0px 4px 16px rgba(0, 0, 0, 0.05)",
  border: "2px solid rgba(255, 255, 255, 0.5)",
  backdropFilter: "blur(32px)",
  position: "relative",
  borderRadius: "12px",
  width: "100%",
 
  "& .MuiTypography-root > sup": {
    fontSize: "9px",
    lineHeight: "9px",
  },
};
 
const data = [
  {
    amount: 13527,
    type: "Processed",
    isCurrency: true,
    isPercentage: false,
  },
  {
    amount: 13527,
    type: "Approved Total",
    isCurrency: true,
    isPercentage: false,
  },
  {
    amount: 0,
    type: "Refund Total",
    isCurrency: true,
    isPercentage: false,
  },
  {
    amount: 0,
    type: "Chargeback Total",
    isCurrency: true,
    isPercentage: false,
  },
  {
    amount: 7,
    type: "Transactions",
    isCurrency: false,
    isPercentage: false,
  },
  {
    amount: 0,
    type: "Approved",
    isCurrency: false,
    isPercentage: true,
  },
  {
    amount: 0,
    type: "Approved",
    isCurrency: false,
    isPercentage: true,
  },
  {
    amount: 0,
    type: "Chargebacks",
    isCurrency: false,
    isPercentage: true,
  },
];
 
const ViewTransactionBannerMobile = () => {
  const theme = useTheme();
  // const { t } = useTranslation(namespaces.pages.manageMoney);
 
  return (
    <Box mb={2} width={358} position="relative">
      {/* ------ Background gradient ------- */}
      <Box sx={backgroundGradient} />
      <Box sx={mainContent}>
        <Box display="flex" justifyContent="space-between">
          <Grid container spacing={2}>
            {data.map((item, index) => (
              <Grid item xs={6} sm={6} key={index}>
                <Box display="flex" flexDirection="column">
                  {item.isCurrency && (
                    <Text
                      variant="h6"
                      fontWeight="medium"
                      color={theme.palette.info.main}
                    >
                      {toEnFormat(item.amount)} <sup>USD</sup>
                    </Text>
                  )}
 
                  {!item.isCurrency && !item.isPercentage && (
                    <Text
                      variant="h6"
                      fontWeight="medium"
                      color={theme.palette.info.main}
                    >
                      {item.amount}
                    </Text>
                  )}
                  {!item.isCurrency && item.isPercentage && (
                    <Text
                      variant="h6"
                      fontWeight="medium"
                      color={theme.palette.info.main}
                    >
                      {toEnFormat(item.amount)} <sup>0.0%</sup>
                    </Text>
                  )}
                  <Text
                    variant="caption"
                    fontWeight="medium"
                    color={theme.palette.neutral[600]}
                  >
                    {item.type}
                  </Text>
                </Box>
              </Grid>
            ))}
          </Grid>
        </Box>
      </Box>
    </Box>
  );
};
 
export default ViewTransactionBannerMobile;