45 lines
1.9 KiB
Vue
45 lines
1.9 KiB
Vue
<script setup lang="ts">
|
|
import type { Hospital, UnitType } from '~/types/game'
|
|
|
|
defineProps<{ hospital: Hospital; secondsUntil: (iso: string) => number }>()
|
|
</script>
|
|
|
|
<!-- The Lazarett: beds taken against beds, the rule, and the wounded of each battle with when they stand again. -->
|
|
<template>
|
|
<section class="panel">
|
|
<div class="panel-head">
|
|
<span class="panel-title">{{ $t('village.hospital.title') }}</span>
|
|
<span class="badge badge-plain tabular-nums" :title="$t('village.hospital.beds')">
|
|
{{ $t('village.hospital.beds_of', { occupied: hospital.occupied, beds: hospital.beds }) }}
|
|
</span>
|
|
</div>
|
|
<div class="panel-body space-y-2 text-sm">
|
|
<p class="text-ink-700">
|
|
{{ $t('village.hospital.rule', { share: Math.round(hospital.share * 100), time: formatDuration(hospital.heal_seconds) }) }}
|
|
{{ $t('village.hospital.short') }}
|
|
</p>
|
|
<table v-if="hospital.wounded.length" class="grid-table">
|
|
<thead>
|
|
<tr>
|
|
<th>{{ $t('village.hospital.units') }}</th>
|
|
<th class="text-right">{{ $t('village.hospital.back_in') }}</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr v-for="w in hospital.wounded" :key="w.id">
|
|
<td>
|
|
<span class="flex flex-wrap items-center gap-x-3 gap-y-0.5">
|
|
<span v-for="[unit, count] in unitRows(w.units)" :key="unit" class="inline-flex items-center gap-1 tabular-nums" :title="$t(`units.${unit}`)">
|
|
<IconUnit :unit="unit as UnitType" class="size-4 text-wood-800" />{{ count }}
|
|
</span>
|
|
</span>
|
|
</td>
|
|
<td class="text-right font-semibold whitespace-nowrap tabular-nums">{{ formatDuration(secondsUntil(w.heals_at)) }}</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p v-else class="text-ink-500">{{ $t('village.hospital.none') }}</p>
|
|
</div>
|
|
</section>
|
|
</template>
|