<template>
  <CommonDialog v-model:show="show">
    <FlexCol gap="gap.lg" width="600rpx" align="center" :padding="35">
      <Image
        src="https://xy.wenlvti.net/app_static/images/home/bless/IconHeader.png"
        :width="300" 
        :height="100" 
      />
      <Height :height="20" />
      <Text 
        textAlign="center" 
        text="感谢您为村社带来的祝福！"
        fontConfig="lightGoldTitle"
      />
    </FlexCol>
  </CommonDialog>
</template>

<script setup lang="ts">
import type { BlessPackageItem } from '@/api/light/TreeApi';
import CommonDialog from '@/common/components/CommonDialog.vue';
import FrameButton from '@/common/components/FrameButton.vue';
import PrimaryButton from '@/common/components/PrimaryButton.vue';
import Image from '@/components/basic/Image.vue';
import Text from '@/components/basic/Text.vue';
import BackgroundBox from '@/components/display/block/BackgroundBox.vue';
import FlexCol from '@/components/layout/FlexCol.vue';
import FlexRow from '@/components/layout/FlexRow.vue';
import Height from '@/components/layout/space/Height.vue';
import { DateUtils } from '@imengyu/imengyu-utils';
import { computed, ref } from 'vue';

const show = ref(false);

const props = defineProps<{
  currentBless?: BlessPackageItem;
}>();
const emit = defineEmits(['buyBless']);

const infoGrids = computed(() => [
  {
    label: '村社加乡源光',
    image: 'https://xy.wenlvti.net/app_static/images/home/bless/IconLight.png',
    value: props.currentBless?.addLight || 0,
    unit: '光',
  },
  {
    label: '用户得乡源果',
    image: 'https://xy.wenlvti.net/app_static/images/home/bless/IconFruit.png',
    value: props.currentBless?.addFruit || 0,
    unit: '个',
  },
]);
const effectiveDate = computed(() => {
  return DateUtils.formatDate(DateUtils.dateAddDays(new Date(), props.currentBless?.days || 0), 'YYYY-MM-DD');
});

defineExpose({
  show: () => {
    show.value = true;
  },
});
</script>