<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="w-152 flex justify-between break-words">
        <div class="w-full mt-15">
          <div class="truncate 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>
      <div class="pl-2 h-full">
        <van-button
          square
          text="撤销审核"
          @click="$emit('onRevoke')"
          type="warning"
          class="delete-button"
        />
      </div>
    </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%;
}
.van-button--warning {
  border: none;
}
</style>
