30 lines
593 B
Vue
30 lines
593 B
Vue
<script setup lang="ts">
|
|
import { useLobbyStore } from "~/store/lobby.store";
|
|
import { useUserStore } from "~/store/user.store";
|
|
|
|
export interface Props {
|
|
id: number;
|
|
}
|
|
|
|
const loading = ref(false);
|
|
|
|
const lobbyStore = useLobbyStore();
|
|
const userStore = useUserStore();
|
|
const props = defineProps<Props>();
|
|
|
|
const game = lobbyStore.games[props.id];
|
|
</script>
|
|
|
|
<template>
|
|
{{ game }}
|
|
<NuxtLink :to="'/game/' + id"
|
|
><input type="button" value="open" :disabled="!userStore.self || loading"
|
|
/></NuxtLink>
|
|
</template>
|
|
|
|
<style lang="css" scoped>
|
|
input:disabled {
|
|
cursor: wait;
|
|
}
|
|
</style>
|