You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
728 B
24 lines
728 B
<script setup>
|
|
import { formatSeconds } from '../libs/time.js'
|
|
import { onMounted, ref, defineExpose } from 'vue'
|
|
|
|
const practiceStatus = ref({})
|
|
|
|
const loadData = async () => {
|
|
const response = await fetch(import.meta.env.VITE_PRACTICE_TRACKER_API_URL+'status')
|
|
practiceStatus.value = await response.json()
|
|
}
|
|
|
|
onMounted(loadData)
|
|
defineExpose({loadData})
|
|
</script>
|
|
<template>
|
|
<h2 @click="loadData">Practice Status</h2>
|
|
<h3>Time Left to Practice Today</h3>
|
|
{{formatSeconds(practiceStatus.seconds_left_to_practice_today)}}
|
|
<h3>Extra Time to Accumulate</h3>
|
|
{{formatSeconds(practiceStatus.seconds_left_to_get_ahead)}}
|
|
<h3>Time Practiced Today</h3>
|
|
{{formatSeconds(practiceStatus.seconds_practiced)}}
|
|
</template>
|