export const useStatamicSitemap = async (options: Options): Promise<Sitemap> => { const { $statamic } = useNuxtApp(); if (!options.site) { options.site = $statamic.site.handle; } const { data } = await useAsyncQuery<{sitemap: Sitemap}>(sitemapQuery, options); const sitemap = data?.value?.sitemap; if (!sitemap) { throw new Error('Missing sitemap from Statamic.'); } return sitemap;};