27 lines
694 B
Vue
27 lines
694 B
Vue
|
|
<script setup lang="ts">
|
||
|
|
import type { Cost, Resources } from '~/types/game'
|
||
|
|
|
||
|
|
defineProps<{
|
||
|
|
cost: Cost
|
||
|
|
/** Projected stock; amounts the village lacks show in red. */
|
||
|
|
have?: Resources | null
|
||
|
|
}>()
|
||
|
|
|
||
|
|
const list = ['wood', 'clay', 'iron'] as const
|
||
|
|
</script>
|
||
|
|
|
||
|
|
<template>
|
||
|
|
<span class="inline-flex flex-wrap items-center gap-x-2.5 gap-y-1 text-xs tabular-nums">
|
||
|
|
<span
|
||
|
|
v-for="r in list"
|
||
|
|
:key="r"
|
||
|
|
class="inline-flex items-center gap-1"
|
||
|
|
:class="have && have[r] < cost[r] ? 'font-semibold text-rose-700' : 'text-ink-700'"
|
||
|
|
:title="$t(`resources.${r}`)"
|
||
|
|
>
|
||
|
|
<IconResource :resource="r" class="size-4" />
|
||
|
|
{{ cost[r] }}
|
||
|
|
</span>
|
||
|
|
</span>
|
||
|
|
</template>
|