Files
AstralRinth/apps/frontend/src/pages/dashboard/analytics.vue
T
xinyihl 453369ca07 feat(frontend): Make dashboard page localizable (#5727)
* Make dashboard page localizable

* dashboard sidebar

* prepr:frontend

* don't change the keys

* undo fix

* fix any err

* don't i18n csv

* prepr:frontend

* fix: do not use button key

* prepr:frontend

* capitalize string date

---------

Co-authored-by: Prospector <6166773+Prospector@users.noreply.github.com>
2026-04-26 13:09:08 +00:00

46 lines
964 B
Vue

<template>
<div>
<Suspense>
<ChartDisplay :projects="projects" :personal="true" />
<template #fallback>
<div class="universal-card">
<h2><span class="label__title">Loading analytics...</span></h2>
</div>
</template>
</Suspense>
</div>
</template>
<script setup>
import {
commonProjectSettingsMessages,
injectModrinthClient,
useDebugLogger,
useVIntl,
} from '@modrinth/ui'
import ChartDisplay from '~/components/ui/charts/ChartDisplay.vue'
const { formatMessage } = useVIntl()
const debug = useDebugLogger('analytics.vue')
definePageMeta({
middleware: 'auth',
})
useHead({
title: () => `${formatMessage(commonProjectSettingsMessages.analytics)} - Modrinth`,
})
const auth = await useAuth()
const client = injectModrinthClient()
const id = auth.value?.user?.id
debug('auth resolved', { id })
const projects = await client.labrinth.users_v2.getProjects(id)
debug('projects resolved', { count: projects?.length })
</script>