<template>
  <view 
    class="d-flex flex-row justify-between shadow-s radius-base mb-3 p-2 pt-3 pb-3 overflow-hidden"
    @click="$emit('click')"
  >
    <view class="d-flex flex-row w-100">
      <image 
        :class="[
          wideImage ? 'width-250' : 'width-150', 
          'height-150', 
          'radius-base',
          'flex-shrink-0'
        ]"
        :src="image"
        mode="aspectFill"
      />
      <view class="d-flex flex-col ml-3 flex-one width-500">
        <text :class="[
          'color-primary',
          desc || title1 ? 'text-lines-1' : 'text-lines-2',
        ]">{{ title }}</text>
        <text class="color-second text-lines-2 mt-2">{{ desc }}</text>
        <RoundTags v-if="tags" :tags="tags" />
      </view>
    </view>
    <text class="color-primary-second-text size-ss">{{ right }}</text>
  </view>
</template>

<script setup lang="ts">
import type { PropType } from 'vue';
import RoundTags from './RoundTags.vue';

defineProps({
  title: String,
  desc: String,
  right: String,
  image: String,

  tags: {
    type: Array as PropType<string[]>,
    default: null
  },
  wideImage: {
    type: Boolean,
    default: false,
  },
  title1: {
    type: Boolean,
    default: false,
  }
})
</script>