<template>
  <div class="leave-common-footer" :class="{ 'footer-column': column }">
    <div class="leave-common-footer-content">
      <div class="leave-common-title">
        {{ list.title }}
      </div>
      <div class="leave-common-footer-list">
        <div
          v-for="item in list.list"
          :key="item.title"
          class="leave-common-footer-item"
        >
          <div class="leave-common-footer-item-icon">
            <span class="j-icon" :class="item.icon" />
          </div>
          <div class="leave-common-footer-item-title">
            <span class="text">{{ item.title }}</span>
            <span v-if="!column" class="splitter">-</span>
            <span class="subtext">{{ item.subtitle }}</span>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import dataList from '@/components/common/index.js'

export default {
  name: 'LeaveCommonFooter',
  props: {
    column: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
      list: dataList
    }
  }
}
</script>

<style lang="scss" scoped>
.leave-common-footer {
  background: url(@/assets/images/BG.png) no-repeat;
  background-size: contain;
  .leave-common-title {
    font-size: 18px;
    line-height: 30px;
  }
  .leave-common-footer-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 16px;
  }
  .leave-common-footer-list {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 12px;
    .leave-common-footer-item {
      display: flex;
      justify-content: center;
      margin-bottom: 10px;
      .leave-common-footer-item-icon {
        img {
          width: 16px;
          height: 16px;
        }
      }
      .leave-common-footer-item-title {
        margin-left: 8px;
        font-size: 12px;
        color: #1d1d1d;
        .text {
          font-weight: bold;
        }
      }
    }
  }

  &.footer-column {
    .leave-common-footer-content {
      align-items: center;
    }
    .leave-common-footer-item-title {
      display: flex;
      flex-direction: column;
    }
    .subtext {
      font-weight: 400;
    }
  }
}
</style>
