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 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 | import * as React from "react";
import { Data } from "./data";
// mui
import Box from "@mui/material/Box";
import Grid from "@mui/material/Grid";
import Stack from "@mui/material/Stack";
import { useTheme } from "@mui/material/styles";
// components
import { Text } from "@common/Text";
import { KeyVal } from "@common/KeyVal";
// localization
import { namespaces } from "localization/resources/i18n.constants";
import { useTranslation } from "react-i18next";
import { PurchaseItem } from "@components/DonationList/Table/FundraisersDonationsTable";
import { RecurringComponent } from "@components/ManageMoney/TransactionTable/RecurringComponent";
type ExpandedRowProps = {
rowData: PurchaseItem;
pinkBorder?: boolean;
};
export const ExpandedRow: React.FC<ExpandedRowProps> = ({
rowData,
pinkBorder,
}) => {
const theme = useTheme();
const { t } = useTranslation(namespaces.pages.sweepstakes);
return (
<Box
sx={{
width: "100%",
p: !pinkBorder
? theme.spacing(2, 1.5, 2, 6.5)
: theme.spacing(0, 0, 0, 0),
"& sup": {
marginLeft: "2px",
fontSize: "9px",
lineHeight: "9px",
},
}}
>
<Grid pb={1} container spacing={1}>
<Grid item xs={6}>
<KeyVal
sx={{ color: theme.palette.neutral[600] }}
keyName={t("fullName")}
value={rowData.sorceAccountFullName}
/>
</Grid>
<Grid item xs={6}>
<KeyVal
sx={{ color: theme.palette.neutral[600] }}
keyName={t("email")}
value={rowData.email}
/>
</Grid>
<Grid item xs={6}>
<KeyVal keyName={t("transactionID")} value={rowData.transactionID} />
</Grid>
<Grid item xs={6}>
<KeyVal keyName={t("processed")} value={rowData.createdAt} />
</Grid>
<Grid item xs={6}>
<KeyVal
keyName={t("nameOnCard")}
value={rowData.sorceAccountFullName}
/>
</Grid>
<Grid item xs={6}>
<KeyVal
keyName={t("revenueSource")}
value={
<Stack
direction="row"
alignItems="center"
justifyContent="space-between"
>
<Text>{rowData.revenue}</Text>
{/* <Text color={theme.palette.primary.main}>
{rowData.transactionAddress}
</Text> */}
</Stack>
}
/>
</Grid>
{/** DIVIDER -------------------------------------------------------------------------------------------------------------------------------------------------- */}
<Grid item xs={12}>
<Box width="100%" borderBottom="2px dashed #DDDCE5" />
</Grid>
{/* <Grid item xs={6}>
<KeyVal
keyName={t("type")}
value={rowData.recurringPurchases[0].type}
/>
</Grid> */}
<Grid item xs={6}>
<KeyVal
keyName={t("Recurrence")}
value={
<RecurringComponent
recurringCount={rowData.recurringCount}
recurringInterval={rowData.recurringInterval}
recurringMax={rowData.recurringMax}
/>
}
/>
</Grid>
<Grid item xs={6}>
<KeyVal
keyName={t("donated")}
value={
<Text>
{rowData.price * rowData.quantity}
<sup>USD</sup> each
</Text>
}
/>
</Grid>
<Grid item xs={6}>
<Grid
container
xs={12}
item
sx={{
padding: "4px 8px",
}}
>
<Grid item xs={3}>
<KeyVal
keyName={t("amount")}
value={
<Text>
{rowData.price * rowData.quantity}
<sup>USD</sup>
</Text>
}
/>
</Grid>
{/* <Grid item xs={3}>
<KeyVal
keyName={t("giveboxFee")}
value={
<Text>
{rowData.recurringPurchases[0].details.giveboxFee}
<sup>USD</sup>
</Text>
}
/>
</Grid> */}
<Grid item xs={3}>
<KeyVal
keyName="Fees"
value={
<Text>
{rowData.fees}
<sup>USD</sup>
</Text>
}
/>
</Grid>
<Grid item xs={3}>
<KeyVal
keyName={t("charged")}
value={
<Text>
{rowData.price * rowData.quantity + rowData.fees}
<sup>USD</sup>
</Text>
}
/>
</Grid>
</Grid>
</Grid>
<Grid item xs={12} display="flex" justifyContent="flex-end">
<Text fontSize={12} color={theme.palette.neutral[600]}>
{t("customerPaidFee")}
</Text>
</Grid>
</Grid>
</Box>
);
};
|