import React from "react"; import AddressDisp from "src/components/Misc/Disp/AddressDisp/AddressDisp"; import { isValidAddr } from "src/utils/Utils"; import { Value } from "@zilliqa-js/contract/src/types"; import "./InitParamsTab.css"; interface IProps { initParams: Value[]; } const InitParamsTab: React.FC = ({ initParams }) => { return ( {initParams.map((param, index) => ( ))}
# Name Type Value
{index} {param.vname} {param.type} {param.value !== undefined ? ( typeof param.value === "object" ? (
                    {JSON.stringify(param.value, null, 2)}
                  
) : Array.isArray(param.value) ? ( param.value .map((x, index) => isValidAddr(x.toString() as string) ? ( ) : ( x.toString() ) ) .map((ele: React.ReactNode, index) => (
{ele}
)) .reduce((acc: React.ReactNode | null, ele) => { return acc === null ? <>{[ele]} : <>{[acc, ele]}; }) ) : isValidAddr(param.value as string) ? ( ) : ( param.value ) ) : null}
); }; export default InitParamsTab;