import { queryBannerList } from '@/api/ad';
import type { AxiosResponse } from 'axios';
import { ref } from 'vue';
import type { BannerResponse } from './types/response';

function fetchBanners() {
  const banners = ref<BannerItem[]>();
  queryBannerList().then((response: AxiosResponse<BannerResponse>) => {
    // console.log(response);
    banners.value = response.data.data.banner_list;
  });

  return { banners };
}

export { fetchBanners };
