mirror of
https://github.com/ericasch6/scrum-poker-internal.git
synced 2026-10-13 18:32:09 +00:00
56 lines
1.6 KiB
Vue
56 lines
1.6 KiB
Vue
<script setup lang="ts">
|
|
import { Head, usePage, usePoll } from '@inertiajs/vue3';
|
|
import { computed } from 'vue';
|
|
|
|
import RoomHeader from '@/components/rooms/RoomHeader.vue';
|
|
import RoomRetentionNotice from '@/components/rooms/RoomRetentionNotice.vue';
|
|
import RoomTable from '@/components/rooms/RoomTable.vue';
|
|
import RoomVoteDeck from '@/components/rooms/RoomVoteDeck.vue';
|
|
import { useRoomRealtime } from '@/composables/useRoomRealtime';
|
|
import type { RoomPageProps } from '@/types/room';
|
|
|
|
const props = defineProps<RoomPageProps>();
|
|
|
|
const page = usePage();
|
|
const roomNotice = computed(() => page.props.roomNotice);
|
|
const canFavorite = computed(
|
|
() => page.props.auth.user?.id != props.room.owner_id,
|
|
);
|
|
|
|
useRoomRealtime(
|
|
() => props.room.id,
|
|
() => props.room.state_version,
|
|
);
|
|
|
|
usePoll(30_000, {
|
|
only: ['room', 'currentPlayer'],
|
|
});
|
|
</script>
|
|
|
|
<template>
|
|
<Head :title="room.title ?? 'Scrum Poker'" />
|
|
|
|
<main
|
|
class="-m-6 min-h-[calc(100svh-4rem)] bg-slate-900 px-3 py-6 text-white sm:px-6 lg:px-10"
|
|
>
|
|
<RoomRetentionNotice v-if="roomNotice" :notice="roomNotice" />
|
|
|
|
<RoomHeader
|
|
:id="room.id"
|
|
:title="room.title"
|
|
:join_code="room.join_code"
|
|
:is_favorite="room.is_favorite"
|
|
:can-favorite="canFavorite"
|
|
/>
|
|
|
|
<RoomTable :room="room" :current-player="currentPlayer" />
|
|
|
|
<RoomVoteDeck
|
|
:room-id="room.id"
|
|
:revealed="room.revealed"
|
|
:cards="room.deck.cards"
|
|
:current-vote="currentPlayer.current_vote"
|
|
/>
|
|
</main>
|
|
</template>
|