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,OAHAa,EAAAA,EAAAA,YAAU,WACRV,GACF,GAAG,IACER,EAASO,MAAMG,cAChBN,GAAgB,SAAC,IAAe,KAElC,UAAC,IAAG,YACF,UAAC,IAAG,CACFjE,GAAI,CACFG,MAAO,OACP6E,OAAQ,QACR/E,QAAS,OACT0B,eAAgB,SAChBsD,QAAS,QACT,WAEF,gBACE7E,MAAO,CAAE8E,SAAU,OAAQC,UAAW,OAAQC,UAAW,WACzDC,IACElB,EAAQmB,aACD,OAAPnB,QAAO,IAAPA,GAAa,QAAN,EAAPA,EAASoB,YAAI,WAAN,EAAP,EAAeC,mBACR,OAAPrB,QAAO,IAAPA,OAAO,EAAPA,EAASN,UAEX4B,IAAI,YAEN,UAAC,IAAG,CAACzF,GAAI,CAAEiF,QAAS,QAAS,WAC3B,SAAC,IAAU,CAACjF,GAAI,CAAE8B,WAAY,OAAQF,SAAU,IAAK,SAClDuC,EAAQpC,WAAaoC,EAAQuB,iBAE7BvB,EAAQvE,UACT,UAAC,IAAU,CAACI,GAAI,CAAE8B,WAAY,OAAQF,SAAU,IAAK,UAClDuC,EAAQvE,QAAO,IAAGuE,EAAQtE,gBAKnC,SAAC,IAAI,UACFkE,EAAa4B,KAAI,SAAC/E,GACjB,OAAO,SAACD,EAAe,CAACC,KAAMA,GAAWA,EAAKgD,IAChD,UApCoC,kCAwC5C,C,2BCtSIgC,EAAyBC,EAAQ,OAKrCC,EAAQ,OAAU,EAElB,IAAIC,EAAiBH,EAAuBC,EAAQ,QAEhDG,EAAcH,EAAQ,OAEtBI,GAAW,EAAIF,EAAeG,UAAuB,EAAIF,EAAYG,KAAK,OAAQ,CACpFC,EAAG,yCACD,iBAEJN,EAAQ,EAAUG,C,4BCfZI,GAAMC,E,SAAAA,KAoBZ,K","sources":["pages/Transactions/Provenance.tsx","../node_modules/@mui/icons-material/ArrowRightAlt.js","../node_modules/@mui/system/esm/Box/Box.js"],"sourcesContent":["import {\n Avatar,\n Collapse,\n List,\n ListItem,\n ListItemAvatar,\n ListItemButton,\n Typography,\n} from \"@mui/material\";\nimport { Box, useTheme } from \"@mui/system\";\nimport { format } from \"date-fns\";\nimport React, { useEffect, useState } from \"react\";\nimport { useHistory, useLocation } from \"react-router\";\nimport { getProvenanceTransacitons, IDocument } from \"../../http\";\nimport { TBalance } from \"../../store\";\nimport { ITransaction } from \"../Profile/types\";\nimport ArrowRightAltIcon from \"@mui/icons-material/ArrowRightAlt\";\nimport { FullPageSpinner } from \"../../components/FullPageSpinner\";\n\nexport interface IProvenance {}\n\nconst tokenTypes = {\n creation: \"Token Creation\",\n};\n\nconst UserBlock = ({\n name,\n balance,\n total,\n}: {\n name: string;\n balance: string;\n total: string;\n}) => {\n const theme = useTheme();\n\n return (\n <Box sx={{ display: \"flex\", alignItems: \"center\", width: \"30%\" }}>\n <Box>\n <ListItemAvatar>\n <Avatar style={{ backgroundColor: theme.palette.primary.main }}>\n <Typography>{name.slice(0, 2)}</Typography>\n </Avatar>\n </ListItemAvatar>\n </Box>\n <Box ml={\"2\"}>\n <Box>\n <Typography>{name}</Typography>\n {!!balance && (\n <Typography>\n {balance}/{total}\n </Typography>\n )}\n </Box>\n </Box>\n </Box>\n );\n};\n\nconst TransactionItem: React.FC<{ item: ITransaction }> = ({ item }) => {\n const [expanded, setExpanded] = useState(false);\n const history = useHistory();\n const senderName =\n (item.senderFirstName || \"\") + \" \" + (item.senderLastName || \"\");\n const receiverName =\n (item.receiverFirstName || \"\") + \" \" + (item.receiverLastName || \"\");\n return (\n <>\n <ListItem key={item.transactionHash}>\n <ListItemButton\n onClick={() => setExpanded((prev) => !prev)}\n // sx={{ display: \"flex\", justifyContent: \"space-between\" }}\n >\n {item.type === tokenTypes.creation ? (\n <Box\n sx={{\n display: \"flex\",\n justifyContent: \"flex-start\",\n alignItems: \"center\",\n width: \"30%\",\n }}\n >\n <Typography fontSize={14} color={\"black\"} fontWeight={\"bold\"}>\n {item.tokenName || item.nftName || \"Item\"}\n </Typography>\n </Box>\n ) : (\n <UserBlock\n balance={item.senderBalance}\n total={item.nftTotal}\n name={senderName}\n />\n )}\n\n <Box\n sx={{\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n width: \"30%\",\n paddingLeft: \"20px\",\n }}\n >\n {item.type === tokenTypes.creation ? (\n <Typography fontSize={14} color={\"black\"} fontWeight={\"bold\"}>\n Was created by\n </Typography>\n ) : (\n <ArrowRightAltIcon color={\"success\"} fontSize={\"small\"} />\n )}\n </Box>\n <UserBlock\n balance={item.receiverBalance}\n total={item.nftTotal}\n name={receiverName}\n />\n <Typography>{item.value}</Typography>\n </ListItemButton>\n </ListItem>\n\n <Collapse in={expanded} timeout=\"auto\" unmountOnExit>\n <List dense>\n {!!item.blockNumber && (\n <ListItem disablePadding disableGutters style={{ paddingLeft: 25 }}>\n <span style={{ fontWeight: \"bold\" }}>Block Number:</span>{\" \"}\n {item.blockNumber}\n </ListItem>\n )}\n <ListItem disablePadding disableGutters style={{ paddingLeft: 25 }}>\n <span style={{ fontWeight: \"bold\" }}>From:</span>{\" \"}\n <span>\n <span\n onClick={() => history.push(\"/explorer/address/\" + item.from)}\n style={{ textDecoration: \"underline\", cursor: \"pointer\" }}\n >\n {item.from}\n </span>\n </span>\n </ListItem>{\" \"}\n {!!item.to && (\n <ListItem disablePadding disableGutters style={{ paddingLeft: 25 }}>\n <span style={{ fontWeight: \"bold\" }}>To:</span>\n <span\n onClick={() => history.push(\"/explorer/address/\" + item.to)}\n style={{ textDecoration: \"underline\", cursor: \"pointer\" }}\n >\n {item.to}\n </span>\n </ListItem>\n )}\n {!!item.fromFirstName && (\n <ListItem disablePadding disableGutters style={{ paddingLeft: 25 }}>\n <span style={{ fontWeight: \"bold\" }}>Sender First Name:</span>\n {item.fromFirstName}\n </ListItem>\n )}\n {!!item.fromLastName && (\n <ListItem disablePadding disableGutters style={{ paddingLeft: 25 }}>\n <span style={{ fontWeight: \"bold\" }}>Sender Last Name:</span>\n {item.fromLastName}\n </ListItem>\n )}\n {!!item.timestamp && (\n <ListItem disablePadding disableGutters style={{ paddingLeft: 25 }}>\n <span style={{ fontWeight: \"bold\" }}>Timestamp:</span>{\" \"}\n {format(new Date(item.timestamp), \"pp PP\")}\n </ListItem>\n )}\n {!!item.toFirstName && (\n <ListItem disablePadding disableGutters style={{ paddingLeft: 25 }}>\n <span style={{ fontWeight: \"bold\" }}>Receiver First Name:</span>\n {item.toFirstName}\n </ListItem>\n )}\n {!!item.toLastName && (\n <ListItem disablePadding disableGutters style={{ paddingLeft: 25 }}>\n <span style={{ fontWeight: \"bold\" }}>Receiver Last Name:</span>\n {item.toLastName}\n </ListItem>\n )}\n {!!item.tokenName && (\n <ListItem disablePadding disableGutters style={{ paddingLeft: 25 }}>\n <span style={{ fontWeight: \"bold\" }}>Token Name:</span>\n {item.tokenName}\n </ListItem>\n )}\n {!!item.transactionIndex && (\n <ListItem disablePadding disableGutters style={{ paddingLeft: 25 }}>\n <span style={{ fontWeight: \"bold\" }}>Transaction Index:</span>\n {item.transactionIndex}\n </ListItem>\n )}\n {!!item.type && (\n <ListItem disablePadding disableGutters style={{ paddingLeft: 25 }}>\n <span style={{ fontWeight: \"bold\" }}>Type:</span>\n {item.type}\n </ListItem>\n )}\n {!!item.value && (\n <ListItem disablePadding disableGutters style={{ paddingLeft: 25 }}>\n <span style={{ fontWeight: \"bold\" }}>Value:</span>\n {item.value}\n </ListItem>\n )}\n {!!item.transactionHash && (\n <ListItem disablePadding disableGutters style={{ paddingLeft: 25 }}>\n <span style={{ fontWeight: \"bold\" }}>Transaction Hash:</span>\n <span\n onClick={() =>\n history.push(\"/explorer/transactions/\" + item.transactionHash)\n }\n style={{ textDecoration: \"underline\", cursor: \"pointer\" }}\n >\n {item.transactionHash}\n </span>\n </ListItem>\n )}\n <ListItem disablePadding disableGutters style={{ paddingLeft: 25 }}>\n <span style={{ fontWeight: \"bold\" }}>Token Id:</span>\n {item.tokenId}\n </ListItem>\n <ListItem disablePadding disableGutters style={{ paddingLeft: 25 }}>\n <span style={{ fontWeight: \"bold\" }}>_id:</span>\n {item._id}\n </ListItem>\n </List>\n </Collapse>\n </>\n );\n};\n\nconst Provenance: React.FC<IProvenance> = ({}) => {\n const location = useLocation<{\n nftItem: TBalance & IDocument;\n walletAddress: string;\n }>();\n const [transactions, setTransactions] = useState<ITransaction[]>([]);\n const [loading, setLoading] = useState(false);\n\n const nftItem = location.state.nftItem;\n const getTransactions = async () => {\n setLoading(true);\n try {\n const res = await getProvenanceTransacitons(\n location.state.walletAddress,\n nftItem.nftId || nftItem._id\n );\n setTransactions(res.data.items.reverse());\n } catch (error) {\n console.log(error);\n }\n setLoading(false);\n };\n useEffect(() => {\n getTransactions();\n }, []);\n if (!location.state.walletAddress) return <p>No Data</p>;\n if (loading) return <FullPageSpinner />;\n return (\n <Box>\n <Box\n sx={{\n width: \"100%\",\n height: \"300px\",\n display: \"flex\",\n justifyContent: \"center\",\n padding: \"10px\",\n }}\n >\n <img\n style={{ maxWidth: \"100%\", maxHeight: \"100%\", objectFit: \"contain\" }}\n src={\n nftItem.nftFileUrl ||\n nftItem?.file?.locationPreview ||\n nftItem?.location\n }\n alt=\"image1\"\n />\n <Box sx={{ padding: \"10px\" }}>\n <Typography sx={{ fontWeight: \"bold\", fontSize: 18 }}>\n {nftItem.tokenName || nftItem.documentName}\n </Typography>\n {!!nftItem.balance && (\n <Typography sx={{ fontWeight: \"bold\", fontSize: 18 }}>\n {nftItem.balance}/{nftItem.total}\n </Typography>\n )}\n </Box>\n </Box>\n <List>\n {transactions.map((item) => {\n return <TransactionItem item={item} key={item._id} />;\n })}\n </List>\n </Box>\n );\n};\nexport default Provenance;\n","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\n\nvar _jsxRuntime = require(\"react/jsx-runtime\");\n\nvar _default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)(\"path\", {\n d: \"M16.01 11H4v2h12.01v3L20 12l-3.99-4z\"\n}), 'ArrowRightAlt');\n\nexports.default = _default;","import PropTypes from 'prop-types';\nimport createBox from '../createBox';\nconst Box = createBox();\nprocess.env.NODE_ENV !== \"production\" ? Box.propTypes /* remove-proptypes */ = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the d.ts file and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * @ignore\n */\n children: PropTypes.node,\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: PropTypes.elementType,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])\n} : void 0;\nexport default Box;"],"names":["tokenTypes","UserBlock","name","balance","total","theme","useTheme","sx","display","alignItems","width","style","backgroundColor","palette","primary","main","slice","ml","TransactionItem","item","useState","expanded","setExpanded","history","useHistory","senderName","senderFirstName","senderLastName","receiverName","receiverFirstName","receiverLastName","onClick","prev","type","justifyContent","fontSize","color","fontWeight","tokenName","nftName","senderBalance","nftTotal","paddingLeft","receiverBalance","value","transactionHash","in","timeout","unmountOnExit","dense","blockNumber","disablePadding","disableGutters","push","from","textDecoration","cursor","to","fromFirstName","fromLastName","timestamp","format","Date","toFirstName","toLastName","transactionIndex","tokenId","_id","location","useLocation","transactions","setTransactions","loading","setLoading","nftItem","state","getTransactions","getProvenanceTransacitons","walletAddress","nftId","res","data","items","reverse","console","log","useEffect","height","padding","maxWidth","maxHeight","objectFit","src","nftFileUrl","file","locationPreview","alt","documentName","map","_interopRequireDefault","require","exports","_createSvgIcon","_jsxRuntime","_default","default","jsx","d","Box","createBox"],"sourceRoot":""}