parent
6b77a0a348
commit
6d56bf4135
@ -0,0 +1,66 @@ |
||||
import React from 'react' |
||||
import {SubmittedContract} from '../types/VerificationTypes' |
||||
|
||||
interface AccordionReceiptProps { |
||||
contract: SubmittedContract |
||||
index: number |
||||
} |
||||
|
||||
export const AccordionReceipt: React.FC<AccordionReceiptProps> = ({contract, index}) => { |
||||
const [expanded, setExpanded] = React.useState(false) |
||||
|
||||
const toggleAccordion = () => { |
||||
setExpanded(!expanded) |
||||
} |
||||
|
||||
return ( |
||||
<div key={contract.address + '-' + index} className={`bg-secondary accordion p-3 ${expanded ? 'open' : ''}`} id={contract.address + '-accordion-' + index}> |
||||
<div className="accordion-item"> |
||||
<h3 className="d-flex flex-row" id={`heading${index}`}> |
||||
<button className={`accordion-button text-left`} type="button" onClick={toggleAccordion} aria-expanded={expanded} aria-controls={`collapse${index}`}> |
||||
{'>'} |
||||
</button> |
||||
<div> |
||||
{contract.address} on {contract.chainId} (Add chain name) |
||||
</div> |
||||
</h3> |
||||
<div id={`collapse${index}`} className={`accordion-collapse p-2 collapse ${expanded ? 'show' : ''}`} aria-labelledby={`heading${index}`} data-bs-parent="#accordionExample"> |
||||
<div className="accordion-body"> |
||||
<div>Chain ID: {contract.chainId}</div> |
||||
<div> |
||||
filePath: {contract.filePath} contractName: {contract.contractName} |
||||
</div> |
||||
<div>Submission Date: {contract.date.toLocaleString()}</div> |
||||
<div> |
||||
Receipts: |
||||
<div className="table-responsive"> |
||||
<table className="table"> |
||||
<thead> |
||||
<tr> |
||||
<th>Verifier</th> |
||||
<th>API Url</th> |
||||
<th>Status</th> |
||||
<th>Message</th> |
||||
<th>ReceiptID</th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
{contract.receipts.map((receipt) => ( |
||||
<tr key={receipt.receiptId}> |
||||
<td>{receipt.verifier.name}</td> |
||||
<td>{receipt.verifier.apiUrl}</td> |
||||
<td>{receipt.status}</td> |
||||
<td>{receipt.message}</td> |
||||
<td>{receipt.receiptId}</td> |
||||
</tr> |
||||
))} |
||||
</tbody> |
||||
</table> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
) |
||||
} |
@ -0,0 +1,34 @@ |
||||
const json = { |
||||
'undefined-0x2738d13E81e30bC615766A0410e7cF199FD59A83-Thu Jun 20 2024 22:32:36 GMT+0200 (Central European Summer Time)': { |
||||
id: 'undefined-0x2738d13E81e30bC615766A0410e7cF199FD59A83-Thu Jun 20 2024 22:32:36 GMT+0200 (Central European Summer Time)', |
||||
address: '0x2738d13E81e30bC615766A0410e7cF199FD59A83', |
||||
filePath: '@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol', |
||||
contractName: 'Initializable', |
||||
date: '2024-06-20T20:32:36.361Z', |
||||
receipts: [ |
||||
{ |
||||
verifier: { |
||||
name: 'Sourcify Localhost', |
||||
apiUrl: 'http://localhost:5555/', |
||||
enabled: true, |
||||
}, |
||||
status: 'error', |
||||
receiptId: null, |
||||
message: 'Failed to fetch', |
||||
}, |
||||
{ |
||||
verifier: { |
||||
name: 'Etherscan', |
||||
apiUrl: 'https://api.etherscan.io', |
||||
enabled: true, |
||||
apiKey: 'API_KEY', |
||||
}, |
||||
status: 'error', |
||||
receiptId: null, |
||||
message: 'Failed to fetch', |
||||
}, |
||||
], |
||||
}, |
||||
} |
||||
|
||||
module.exports = json |
Loading…
Reference in new issue