import fetcher from './fetcher';

interface Params {
  slug: string;
}


export const getPage = async (): Promise<IPageRenderer> => {
  const query = `/pages?filters[slug]=home&populate[components][on][banner.banner][populate][specifications][populate]=*&populate[components][on][banner.banner][populate][image][populate]=*&populate[components][on][image-carousel.image-carousel][populate][slides][populate]=*&populate[components][on][amenities.amenities][populate][image][populate]=*&populate[components][on][gallery.gallery][populate][gallery][populate]=*&populate[components][on][address-map.address-map][populate]=*`;

  const response = await fetcher<IPageRenderer[]>(query);

  return response[0];
};
