<script lang='ts' setup>
import { ConstKeys } from '~/enums/const-enums'
import { Api } from '@/api/model/url'

const list = ref<any>([])
const requestUrl = `${ConstKeys.DOMAINDEV}${Api.BlogsList}`
const params = { pageNo: 1, pageSize: 3, orderBy: 'createTime', orderType: 'desc' }
const { data, pending, error, refresh } = await useAsyncData(
  'blog-list',
  () => $fetch(requestUrl, { params }),
)
list.value = data.value?.result?.records || []
</script>

<template>
  <div
    v-if="list.length"
    class="bg-#fff py-120px data-section"
    data-section-color="#ffffff"
  >
    <div class="w-1200-auto text-center">
      <h2 class="!text-36px !fw-800 text-#333 !mb-44px custom-title-font">
        EJET Spark <span class="custom-title-bg03">Blog</span>
      </h2>
      <div class="flex items-center justify-end text-#9B6CFF cursor-pointer text-14px fw-bold mb-20px">
        View All
        <svgo-arrow-line-r class="w-16px h-16px ml-10px" />
      </div>
      <div class=" grid grid-cols-3 gap-40px text-left">
        <div v-for="item, index in list" :key="index">
          <common-blog-item :item="item" />
        </div>
      </div>
    </div>
  </div>
</template>

<style lang='less' scoped>

</style>
