<template>
  <div class="info">
    <div class="notifi-classifi">
      <div class="pf600 fs18 fc121212" @click="messageChange('coinInfo')">币种信息</div>
      <div
        class="sys-notifi pf600 fs14 fcA8A8A8"
        @click="messageChange('transactionRelu')">
        交易规则
      </div>
    </div>
    <component :is="currentComponent" />
  </div>
</template>
<script setup>
  import CoinInfo from "./CoinInfo.vue";
  import TransactionRelu from "./TransactionRelu.vue";
  import { ref, computed } from "vue";

  const current = ref("coinInfo");
  const componentsMap = {
    coinInfo: CoinInfo,
    transactionRelu: TransactionRelu,
  };
  const currentComponent = computed(() => componentsMap[current.value]);

  const messageChange = (key) => {
    current.value = key;
  };
</script>
<style lang="less" scoped>
  .info {
    width: 349px;

    .notifi-classifi {
      display: flex;
      flex-direction: row;
      justify-content: flex-start;
      align-items: flex-end;
      margin-top: 15px;
      width: 349px;
      height: 24px;

      .sys-notifi {
        margin-left: 47px;
      }
    }
  }
</style>
