2026-10-28 21:05:45 +00:00
|
|
|
<script setup lang="ts">
|
|
|
|
|
import type { Levy, Starvation } from '~/types/game'
|
|
|
|
|
|
|
|
|
|
defineProps<{
|
|
|
|
|
starvation: Starvation
|
|
|
|
|
levy: Levy
|
|
|
|
|
secondsUntil: (iso: string) => number
|
|
|
|
|
}>()
|
|
|
|
|
</script>
|
|
|
|
|
|
2026-10-29 00:26:08 +00:00
|
|
|
<!-- A thin notice under the village header while the food stock drains or is empty. -->
|
2026-10-28 21:05:45 +00:00
|
|
|
<template>
|
|
|
|
|
<div
|
|
|
|
|
v-if="starvation.since"
|
2026-10-29 00:26:08 +00:00
|
|
|
class="flex flex-wrap items-center gap-x-3 gap-y-0.5 border border-blood-800 bg-blood-700 px-2 py-0.5 text-[13px] text-parchment-50"
|
2026-10-28 21:05:45 +00:00
|
|
|
role="alert"
|
|
|
|
|
>
|
|
|
|
|
<IconResource resource="food" class="size-5" />
|
|
|
|
|
<span class="font-semibold">{{ $t('village.food.starving') }}</span>
|
|
|
|
|
<span v-if="starvation.desertion_at">
|
|
|
|
|
{{ $t('village.food.desertion_in') }}
|
|
|
|
|
<span class="font-semibold tabular-nums">{{ formatDuration(secondsUntil(starvation.desertion_at)) }}</span>
|
|
|
|
|
</span>
|
|
|
|
|
<span class="w-full text-xs text-parchment-200 sm:ml-auto sm:w-auto">
|
|
|
|
|
{{ levy.militia ? $t('village.food.fix_levy') : $t('village.food.fix') }}
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div
|
|
|
|
|
v-else-if="starvation.food_empty_at"
|
2026-10-29 00:26:08 +00:00
|
|
|
class="flex flex-wrap items-center gap-x-3 gap-y-0.5 border border-gold-600 bg-gold-400 px-2 py-0.5 text-[13px] text-ink-900"
|
2026-10-28 21:05:45 +00:00
|
|
|
role="status"
|
|
|
|
|
>
|
|
|
|
|
<IconResource resource="food" class="size-5" />
|
|
|
|
|
<span>
|
|
|
|
|
{{ $t('village.food.runs_out_in') }}
|
|
|
|
|
<span class="font-semibold tabular-nums">{{ formatDuration(secondsUntil(starvation.food_empty_at)) }}</span>
|
|
|
|
|
</span>
|
|
|
|
|
<span class="w-full text-xs text-ink-700 sm:ml-auto sm:w-auto">
|
|
|
|
|
{{ levy.militia ? $t('village.food.fix_levy') : $t('village.food.then') }}
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|