import { defineComponent, computed } from 'vue';
import { useI18n } from 'vue-i18n';
import './index.less';
export default defineComponent({
  props: {
    time: {
      type: Number,
      default: 0,
    },
  },
  setup(props) {
    const { t } = useI18n();
    // 获取倒计时
    const getCountDown = computed(() => {
      let list: any = [
        {
          label: t('raffle.day'),
          value: '00',
        },
        {
          label: t('raffle.hour'),
          value: '00',
        },
        {
          label: t('raffle.minute'),
          value: '00',
        },
        {
          label: t('raffle.second'),
          value: '00',
        },
      ];
      return list;
    });
    return () => (
      <div class="custom-countdown-box">
        {getCountDown.value.map((item: any, index: number) => (
          <div class="custom-count-time">
            <div class="time-child">
              <div class="time-value">{item.value}</div>
              {index != getCountDown.value.length - 1 ? (
                <div class="dot-box">
                  <div></div>
                  <div></div>
                </div>
              ) : (
                ''
              )}
            </div>
            <div class="time-label">{item.label}</div>
          </div>
        ))}
      </div>
    );
  },
});
