on df0c310 help sign in
bridge/src/components/L2/PendingTransaction.tsx
46 lines 1.1 kB history raw
1import { Box, Row, Icon } from '@tlon/indigo-react';
2import { useExploreTxUrl } from 'lib/explorer';
3import LayerIndicator from './LayerIndicator';
5import './PendingTransaction.scss';
7interface Props {
8 title: string;
9 nextRoll?: string;
10 hash?: string;
11 layer: 1 | 2;
14const PendingTransactionComponent: React.FC<Props> = ({
15 title,
16 nextRoll,
17 hash,
18 layer,
19}) => {
20 const txHash = useExploreTxUrl(hash);
22 return (
23 <Box className="pending-transaction">
24 <Row className="title-row">
25 <Box className="title">{title}</Box>
26 {hash ? (
27 <a className="hash" href={txHash} rel="noreferrer" target="_blank">
28 Etherscan
29 <Icon className="arrow" icon="ArrowEast" />
30 </a>
31 ) : (
32 <Box className="rollup-timer">
33 <Icon icon="Clock" />
34 {nextRoll}
35 </Box>
36 )}
37 </Row>
38 <Row className="info-row">
39 <LayerIndicator layer={layer} size="sm" />
40 <Box className="date"></Box>
41 </Row>
42 </Box>
43 );
44};
46export default PendingTransactionComponent;