import React from 'react'; import type { AbiFunction } from 'viem'; import type { AbiFallback, ResultViewMode } from '../types'; import { Alert } from 'toolkit/chakra/alert'; import ResultItem from './resultPublicClient/Item'; export interface Props { data: unknown; abiItem: AbiFunction | AbiFallback; onSettle: () => void; mode: ResultViewMode; } const ContractMethodOutput = ({ data, abiItem, onSettle, mode }: Props) => { React.useEffect(() => { if (mode === 'result') { onSettle(); } }, [ onSettle, mode ]); const formattedData = (() => { return abiItem && abiItem.outputs.length > 1 && Array.isArray(data) ? data : [ data ]; })(); return ( { abiItem.outputs.map((output, index) => ( )) } ); }; export default React.memo(ContractMethodOutput);