<template>
  <n-card class="info-box">
    <template #cover>
      <div class="cover">
        <img :src="cover" />
      </div>
    </template>
    <div class="info-line">
      <div class="title">{{ title }}</div>
      <div class="time-line">
        <span> {{ time }}</span>
        <div class="see-more" @click="$router.push(`/info-detail/${id}`)">
          查看
          <img class="see-more-img" src="/img/see_more.png" alt="see more" />
        </div>
      </div>
    </div>
  </n-card>
</template>
<script setup>
defineOptions({
  name: "info-box",
});

defineProps({
  id: {
    type: [Number, String],
    default: () => NaN,
  },
  title: {
    type: [String, undefined],
    default: () => "",
  },
  cover: {
    type: [String, undefined],
    default: () => "",
  },
  time: {
    type: [String, undefined],
    default: () => "",
  },
});
</script>

<style>
.info-box {
  --box-remark-color: #9b9b9b;
}
</style>
<style lang="scss" scoped>
.n-card.info-box {
  padding: .625rem;
  --n-padding-left: 0 !important;
  --n-padding-bottom: 0 !important;
  // width: 32.1875rem;
  // height: 26.5rem;
  background: #f5f5f5;
  box-shadow: 0rem .125rem .25rem 0rem rgba(46,25,16,0.16);
  border-radius: .8125rem;
  border-top: .5rem solid var(--main-primary-color);
  .cover {
    background-color: gray;
    overflow: hidden;
    max-height: 17.75rem;
  }
  .title {
    font-size: 1.625rem;
    margin: .9375rem 0;
  }
  .info-line {
    display: flex;
    flex-direction: column;
    .time-line {
      width: 100%;
      flex: 1;
      display: flex;
      justify-content: space-between;
      color: var(--box-remark-color);
      font-size: 1rem;
      .see-more {
        cursor: pointer;
        display: inline-flex;
        justify-content: center;
        align-items: center;
        img {
          max-height: 1rem;
          width: auto;
          margin-left: .3125rem;
        }
      }
    }
  }
}
</style>
