<template>
  <div class="flex pl-6 py-6 pr-10 minw-120 items">
    <div class="w-36 h-36 round-4 bg-444 flex-center">
      <SvgIcon :name="item.icon" :size="24" />
    </div>
    <div class="descbox">
      <div class="flex flex-col justify-center ml-10 desc-content">
        <i class="fs-14">{{ item.title }}</i>
        <i v-if="item.desc" class="opacity-50 fs-12 desc">{{ item?.desc }}</i>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import SvgIcon from '@/components/SvgIcon/SvgIcon.vue';
defineProps({
  item: {
    type: Object as () => { title: string; desc: string, icon: string; type: string},
    required: true,
    default: () => ({ title: '文本', desc: '剧本、分镜、提示词', type: 'text', icon: 'text'}),
  },
});
</script>

<style scoped lang="scss">
.items {
  .descbox {
    .desc-content {
      transform: translateY(10px);
      transition: all 0.3s;

      .desc {
        height: 0;
        overflow: hidden;
        transition: height 0.3s;
      }
    }
  }

  &:hover {
    background: #444;
    border-radius: 4px;

    .desc-content {
      transform: translateY(0);

      .desc {
        height: 16px;
      }
    }
  }
}
</style>
