<template>
  <div class="block-detail min-w-1200 md:w-bodySet mx-auto flow-root">
    <chain-search
      style="margin-top: 30px;"
      :clickSearch="clickSearch"
      :value="searchValue"
      :setValue="setSearchValue"
    ></chain-search>
    <block-overview
      style="margin-top: 30px; margin-bottom: 30px;"
      :data="overview"
      :init="init"
      :loading="loadingOverview"
      :loadingRelativeBlockHeight="loadingRelativeNumber"
    ></block-overview>
    <TabList
      :tabList="tabList"
      :setFocusedTab="(v) => (focusedTab = v)"
      :focusedTab="focusedTab"
    ></TabList>
    <DataFilter
      v-if="focusedTab === '1'"
      :optionList="optionList"
      :setValue="selectOption"
      :value="selectedOption"
    >
      <template #left>
        {{ $t('lang.trade.txTotal', [pages.total]) }}
      </template>
    </DataFilter>
    <TradeTable
      v-if="focusedTab === '1'"
      :groupCellName="groupCellName"
      :Loading="loadingTable"
      :Trades="Trades"
      :pages="pages"
      :sizeChange="sizeChange"
      :pageChange="pageChange"
    ></TradeTable>
  </div>
</template>

<script lang="ts">
import ChainSearch from '@/components/pc/BlockChainBrowser/ChainSearch.vue'
import BlockOverview from '@/components/pc/BlockChainBrowser/BlockOverview/index.vue'
import TabList from '@/components/pc/BlockChainBrowser/TabList/index.vue'
import DataFilter from '@/components/pc/BlockChainBrowser/DataFilter/index.vue'
import TradeTable from '@/components/pc/BlockChainBrowser/TradeTable/index.vue'
import blockDetailMixin from '@/mixin/blockDetail'
import VueTypedMixins from 'vue-typed-mixins'

export default VueTypedMixins(blockDetailMixin).extend({
  components: {
    ChainSearch,
    BlockOverview,
    TabList,
    DataFilter,
    TradeTable,
  },
})
</script>

<style scoped>
.block-detail {
  margin-top: 70px;
}
</style>
