feat(fe): added header

ToDo: connect clock to shows, style corrections
This commit is contained in:
Marco Cavalli 2025-03-04 17:10:30 +01:00
parent 0b570a25af
commit 75d56a1b7b
3 changed files with 16 additions and 6 deletions

View file

@ -20,7 +20,7 @@ const items = [
{ {
id: 3, id: 3,
name: "Musichetta buffa", name: "Musichetta buffa",
type: "jingle", type: "show",
when: "12:10" when: "12:10"
}, },
]; ];

View file

@ -1,13 +1,23 @@
<script setup lang="ts"> <script setup lang="ts">
import axios from "axios";
import {useAuthStore} from "@/stores/auth.store.ts"; import {useAuthStore} from "@/stores/auth.store.ts";
import {computed, ref} from "vue";
const auth = useAuthStore(); const auth = useAuthStore();
const timezone = auth.userData.timezone;
const time = ref(new Date().toLocaleString("it-IT", {timeZone: timezone}));
setInterval(() => {
time.value = new Date().toLocaleString("it-IT", {timeZone: timezone});
}, 1000)
</script> </script>
<template> <template>
<div class="timer">
<span>
{{ time }}
</span>
</div>
</template> </template>
<style scoped> <style scoped>

View file

@ -3,6 +3,9 @@ const props = defineProps([
'item' 'item'
]); ]);
/**
* Get Show/Spot icon
*/
const icon = () => { const icon = () => {
switch (props.item.type) { switch (props.item.type) {
case 'show': case 'show':
@ -11,9 +14,6 @@ const icon = () => {
case 'ad': case 'ad':
return 'mdi-advertisements'; return 'mdi-advertisements';
break; break;
case 'jingle':
return 'mdi-music';
break;
} }
} }
</script> </script>