feat(ui): add realtime feed view
This commit is contained in:
53
ui/src/views/RealtimeFeedView.vue
Normal file
53
ui/src/views/RealtimeFeedView.vue
Normal file
@@ -0,0 +1,53 @@
|
||||
<script setup>
|
||||
import { onMounted } from 'vue'
|
||||
import { useRealtimeStore } from '@/stores/useRealtime'
|
||||
import RealtimeEventCard from '@/components/realtime/RealtimeEventCard.vue'
|
||||
|
||||
const realtime = useRealtimeStore()
|
||||
|
||||
onMounted(() => {
|
||||
realtime.init()
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="realtime-feed-container">
|
||||
<header class="page-header">
|
||||
<h1>Feed en Tiempo Real</h1>
|
||||
</header>
|
||||
|
||||
<div class="feed-list overflow-auto pr-2" style="max-height: calc(100vh - 160px);">
|
||||
<RealtimeEventCard
|
||||
v-for="(ev, idx) in realtime.events"
|
||||
:key="idx"
|
||||
:event="ev"
|
||||
/>
|
||||
<div v-if="realtime.events.length === 0" class="text-center text-gray-500 mt-4">
|
||||
No hay eventos aún.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.realtime-feed-container {
|
||||
padding: 20px;
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.page-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 25px;
|
||||
padding-bottom: 10px;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
|
||||
.page-header h1 {
|
||||
color: var(--primary-color);
|
||||
font-size: 2.2em;
|
||||
font-weight: 600;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user