<template>
  <van-swipe-cell>
    <div class="relative flex mb-10 border-[#fff] space-x-10 p-10 rounded-xl bg-[#FFF]">
      
      <div class="w-147 h-109 border-box">
        <img
        :src="formatImgSrc(data?.tourismUrlsAfterConvert) || noteDraftCoverBg"
        class="w-full h-full shrink-0  object-cover"
      />
      </div>
     

      <div class="flex w-0 flex-1 flex-col justify-between">
        <div class="mt-15">
          <div class="line-clamp-1  truncate break-all text-base font-semibold text-black-3">
            {{ data?.projectTitle || '未命名草稿' }}
          </div>
          <div class="mt-2 text-sm text-black-3">
            {{ $dayjs(data?.updateTime).format('YYYY/MM/DD') }}
          </div>
        </div>

        <div class="absolute top-1/2 right-0 -translate-y-1/2 z-1 w-11 h-10">
          <img class="w-full h-full" :src="left_arrow" alt="" />
        </div>
      </div>
    </div>

    <template #right>
      <van-button
        square
        text="撤销审核"
        @click="$emit('onRevoke')"
        type="warning"
        class="delete-button"
      />
    </template>
  </van-swipe-cell>
</template>

<script setup>
import noteDraftCoverBg from '~/assets/img/note-create/note_draft_cover_bg.jpg'
import left_arrow from '~/assets/img/note-create/left.svg'
const props = defineProps({
  data: {
    type: Object,
    default: () => ({})
  }
})

defineEmits(['onRevoke'])

function handleWrite() {
  navigateTo({
    path: '/note-create',
    query: {
      id: props.data.id
    }
  })
}
</script>

<style lang="scss" scoped>
.delete-button {
  height: 100%;
}
</style>
