<template>
  <van-swipe-cell>
    <div class="relative group flex space-x-10 p-10 transition-all rounded-xl bg-[#FFF]">
      <img
        :src="formatImgSrc(data?.tourismUrlsAfterConvert) || noteDraftCoverBg"
        class="aspect-[4/3] h-109 shrink-0 object-cover"
      />

      <div class="flex w-0 flex-1 flex-col justify-between">
        <div class="mt-15">
          <div class="line-clamp-1 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 @click="$emit('onRevoke')" class="flex mb-10 items-center space-x-5">
          <div class="flex cursor-pointer items-center p-5 text-primary">
            <span class="w-15 h-15">
              <img
                class="w-full h-full shrink-0 object-cover"
                src="~/assets/img/note-create/cancel.svg"
                alt=""
              />
            </span>
            <span class="text-base">撤销审核</span>
          </div>
        </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>
