<template>
  <div class="dialog-tab">
    <div
      v-for="tab in tabList"
      :key="tab.name"
      :class="['tab-pane', currentTab == tab.name ? 'active' : '']"
      @click="changeTab(tab.name)"
    >
      {{ tab.label }}
    </div>
    <div class="separate-lines">
      <div class="separate-line"></div>
      <img
        class="separate-arrow"
        src="@/assets/images/common/icon_tab_arr.png"
      />
    </div>
  </div>
</template>
<script>
export default {
  name: "DialogTabs",
  props: {
    currentTab: {
      type: String,
      default: "",
    },
    tabList: {
      type: Array,
      default: () => {
        return [];
      },
    },
  },
  methods: {
    changeTab(tabName) {
      this.$emit("change", tabName);
    },
  },
  data() {
    return {};
  },
};
</script>
<style lang="less" scoped>
.dialog-tab {
  width: 100%;
  display: flex;
  justify-content: space-between;
  .tab-pane {
    font-size: 16px;
    color: #82a4e4;
    line-height: 20px;
    padding: 0 10px;
    border-left: 1px solid #2857ae;
    cursor: pointer;
    &:hover {
      color: #fff;
    }
    &.active {
      padding-left: 30px;
      position: relative;
      color: #fff;
      &::before {
        position: absolute;
        content: "";
        width: 4px;
        height: 4px;
        background: #23ddff;
        border: 3px solid #fff;
        border-radius: 50%;
        left: 10px;
        top: 50%;
        transform: translateY(-50%);
      }
    }
  }
  .separate-lines {
    flex-grow: 1;
    border-left: 1px solid #2857ae;
    display: flex;
    align-items: center;
    .separate-line {
      display: flex;

      height: 1px;
      background: #2857ae;
      flex-grow: 1;
    }
    .separate-arrow {
      width: 20px;
      padding-left: 4px;
      vertical-align: top;
    }
  }
}
</style>