<template>
  <div class="help-center-card">
    <p class="Hc-card-title" v-if="title">{{ title }}</p>
    <div
      v-for="item in content"
      :key="item.q"
      class="Hc-card-container"
      @click="goAnswer(type, item.id)"
    >
      <div class="Hc-container-item">
        <div class="Hcc-item-left">
          <i class="Hcci-left-icon">Q</i>
          <span class="Hcci-left-text">{{ item.q }}</span>
        </div>
        <svg-icon icon-class="triangle-down" class="Hcc-item-right" />
      </div>
      <cr-divider :hairline="false" :style="{ background: '#EBEBEB' }" />
    </div>
  </div>
</template>
<script>
export default {
  name: "HelpCenterCard",
  props: {
    type: {
      type: String,
      default: ""
    },
    title: {
      type: String,
      default: ""
    },
    content: {
      type: Array,
      default: () => []
    }
  },
  methods: {
    goAnswer(type, id) {
      this.$router.push(`/user/help-center/answer/${type}/${id}`);
    }
  }
};
</script>
<style scoped lang="less">
@import "../../../../style/index.less";

.help-center-card {
  .Hc-card-title {
    padding: 8px 0 5px;
    font-size: 18px;
    color: #242629;
    font-weight: 600;
    line-height: 24px;
  }
  .Hc-card-container {
    .Hc-container-item {
      display: flex;
      justify-content: space-between;
      align-items: center;
      height: 24px;
      color: @black;
      font-weight: @font-weight-bold;
      padding: @padding-md 0;
      .Hcc-item-left {
        display: flex;
        align-items: center;
        .Hcci-left-icon {
          font-size: @font-size-12;
          font-weight: @font-weight-bold;
          font-style: normal;
          line-height: 22px;
          height: 20px;
          text-align: center;
          width: 20px;
          border-radius: @border-radius-sm / 4 @border-radius-md / 2;
          background-color: @orange-light;
          box-shadow: 0px 6px 25px 0px rgba(255, 200, 66, 0.2);
        }
        .Hcci-left-text {
          margin-top: 2px;
          margin-left: 10px;
          font-weight: @font-weight-bold;
          font-size: @font-size-14;
          line-height: 24px;
        }
      }
      .Hcc-item-right {
        transform: rotate(-90deg);
        height: 17px;
        width: 17px;
        transition: all 0.2s linear;
      }
    }
  }
}
</style>
