New Code Editor and fun
This commit is contained in:
19
src/components/FightStatistics.svelte
Normal file
19
src/components/FightStatistics.svelte
Normal file
@@ -0,0 +1,19 @@
|
||||
<script lang="ts">
|
||||
import {statsRepo} from "./repo/repo.ts";
|
||||
import FightStatsChart from "./FightStatsChart.svelte";
|
||||
import {t} from "astro-i18n";
|
||||
|
||||
let request = getStats();
|
||||
|
||||
function getStats() {
|
||||
return $statsRepo.getFightStats();
|
||||
}
|
||||
</script>
|
||||
|
||||
{#await request}
|
||||
<p>{t("status.loading")}</p>
|
||||
{:then stats}
|
||||
<FightStatsChart data={stats} />
|
||||
{:catch error}
|
||||
<p>error: {error}</p>
|
||||
{/await}
|
||||
Reference in New Issue
Block a user