const StyledContainer = styled.div` padding-top: 34px; width: 1244px; margin: 0 auto; `; const StyledHeader = styled.div` display: flex; align-items: center; justify-content: space-between; `; State.init({ tab: "market", chainId: -1, chainIndex: 0, updater: 0, }); const { CHAIN_LIST, curChain, dexConfig, wethAddress, multicallAddress, multicall, prices, onSwitchChain, switchingChain, addAction, toast, chainId, nativeCurrency, isChainSupported, account, from, } = props; const { type } = dexConfig; if (!account || !isChainSupported) { return ( <Widget src="bluebiu.near/widget/Swap.ChainWarnigBox" props={{ chain: curChain, onSwitchChain: onSwitchChain, switchingChain: switchingChain, theme: dexConfig.theme?.button, }} /> ); } let tabsArray = [ { key: "market", label: "Market" }, { key: "yours", label: "Yours" }, ]; return ( <StyledContainer style={dexConfig.theme}> <StyledHeader> <Widget src="bluebiu.near/widget/Lending.CardTabs" props={{ tabs: tabsArray, active: state.tab, onChange: (tab) => { State.update({ tab: tab.key, }); }, }} /> {/* <Widget src="bluebiu.near/widget/Lending.Chains" props={{ chains: CHAIN_LIST, curChain, onSwitchChain, from, onChange: (tab) => { State.update({ tab: tab.key, }); }, }} /> */} <Widget src="bluebiu.near/widget/Lending.CompoundV2.Chains" props={{ from, curChain, chains: CHAIN_LIST, onSwitchChain: ({ chainId }) => { onSwitchChain({ chainId: Number(chainId) }); State.update({ updater: state.updater + 1, }); }, // onChangeChainIndex: handleChangeChainIndex, }} /> </StyledHeader> <Widget src="bluebiu.near/widget/Lending.CompoundV2.Content" props={{ dexConfig, wethAddress, multicallAddress, multicall, prices, chainIdNotSupport: !isChainSupported, account, addAction, toast, chainId, nativeCurrency, tab: state.tab, from, updater: state.updater, }} /> </StyledContainer> );