<template>
  <div
    class="bg-white rounded-[24px] overflow-hidden border border-[#0f172a]/[0.04] shadow-[0_10px_28px_rgba(15,23,42,0.04)]">
    <div class="h-[206px] pt-[8px] px-[8px] relative">
      <image class="poi-detail-card__image w-full h-full block rounded-18" :src="data.image" />
      <div
        class="absolute top-[18px] left-[22px] min-h-[30px] px-[12px] rounded-full text-[#059669] bg-white/90 backdrop-blur-[8px] flex items-center gap-4 text-[10px] font-bold">
        <span class="text-[13px] leading-none">⌖</span>
        <span>{{ data.badge?.text }}</span>
      </div>
    </div>

    <div class="pt-[18px] px-[26px] pb-[24px]">
      <div class="leading-[32px] letter-spacing-0 text-[#1e293b] font-size-24 font-bold">
        {{ data.title }}
      </div>

      <div
        class="min-h-[46px] mt-[16px] px-[14px] border border-[#d1fae5] rounded-[12px] bg-gradient-to-r from-[#ecfdf5] to-[#f0fdf4]/[0.34] flex items-center gap-10">
        <div class="leading-none text-[#047857] text-[18px] font-bold">✦</div>
        <div class="flex-1 min-w-0 leading-[20px] text-[#047857] text-[14px] font-bold">
          {{ data.tip?.text }}
        </div>
      </div>

      <div
        class="h-[54px] mt-[16px] rounded-[14px] flex items-center justify-center gap-8 text-white bg-0F172A text-[16px] font-bold"
        :class="{ 'opacity-55': disabled }" @click="handleAction">
        <span class="text-[18px] leading-none">↗</span>
        <span>{{ data.action?.text }}</span>
      </div>
    </div>
  </div>
</template>

<script setup>
const props = defineProps({
  data: {
    type: Object,
    default: () => ({}),
  },
  disabled: {
    type: Boolean,
    default: false,
  },
});

const emit = defineEmits(["action"]);

const handleAction = () => {
  if (props.disabled) return;
  emit("action", props.data);
};
</script>
