Something went wrong. Try again.
a Page to view some global statistics about Modrinth modrinth-statistics.tobinio.dev
Something went wrong. Try again.
524 B · 27 lines
TypeScript
at icons
12345678910111213141516171819202122232425262728export function useStatData( isGlobalStats: Ref<boolean>, isRevenueStats: Ref<boolean>, time: Ref<string>, // biome-ignore lint: params: Record<string, any>,) { const url = computed(() => { if (isGlobalStats.value) { return "/api/stats/time/global"; }
if (isRevenueStats.value) { return "/api/stats/time/revenue"; }
return time.value === "current" ? "/api/stats/projects" : "/api/stats/time/projects"; });
const { data } = useFetch<StatExport>(url, { query: params, });
return data;}