import React from 'react'; import PropTypes from 'prop-types'; import { useGasFeeContext } from '../../../contexts/gasFee'; import { useI18nContext } from '../../../hooks/useI18nContext'; import Box from '../../ui/box'; import EditGasFeeButton from '../edit-gas-fee-button'; import TransactionDetailItem from '../transaction-detail-item/transaction-detail-item.component'; export default function TransactionDetail({ rows = [], onEdit, userAcknowledgedGasMissing = false, }) { const t = useI18nContext(); const { supportsEIP1559V2 } = useGasFeeContext(); return (
{supportsEIP1559V2 && ( )} {!supportsEIP1559V2 && onEdit && (
)}
{rows}
); } TransactionDetail.propTypes = { /** * Show item content for transaction detail. Array of TransactionDetailItem components */ rows: PropTypes.arrayOf(TransactionDetailItem).isRequired, /** * onClick handler for the Edit link */ onEdit: PropTypes.func, userAcknowledgedGasMissing: PropTypes.bool, };