game-village-politics-frontend/app/components/game/VillageNotices.vue

23 lines
1.0 KiB
Vue
Raw Normal View History

<script setup lang="ts">
const props = defineProps<{ villageId: number }>()
const v = useVillageContext()
</script>
<!-- Under the village bar: beginner protection, a world that ended, hunger, and errors. -->
<template>
<GameProtectionBar
v-if="v.village.value?.rally.protected_until"
:until="v.village.value.rally.protected_until"
:village-id="props.villageId"
:seconds-until="v.secondsUntil"
/>
<div v-if="v.village.value" class="space-y-1 empty:hidden">
<p v-if="v.village.value.season.winner" class="border border-gold-600 bg-parchment-100 px-2 py-0.5 text-sm text-wood-900">
{{ $t('village.world_ended', { player: v.village.value.season.winner.name }) }}
<NuxtLink to="/worlds" class="ml-2 font-semibold text-blood-700 underline">{{ $t('village.season.next') }}</NuxtLink>
</p>
<VillageFoodWarning :starvation="v.village.value.starvation" :levy="v.village.value.levy" :seconds-until="v.secondsUntil" />
</div>
<p v-if="v.error.value" class="alert" role="alert">{{ v.error.value }}</p>
</template>