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

27 lines
932 B
Vue
Raw Normal View History

<script setup lang="ts">
import type { BuildingType } from '~/types/game'
defineProps<{
/** The building the screen belongs to, drawn as it stands; null when it doesn't stand yet. */
type: BuildingType
level: number | null
title: string
description: string
}>()
</script>
<!-- The top of a building screen, like Die Stämme's: the building's picture, "Name (Level n)", and one line on what it does. -->
<template>
<header class="flex items-start gap-3">
<VillagePortraitTile :type="type" :level="level ?? 1" class="size-16 p-0.5" />
<div class="min-w-0">
<h1 class="font-display text-lg leading-tight font-bold text-wood-950">
{{ title }}
<span v-if="level !== null" class="font-normal">({{ $t('village.buildings.level_n', { level }) }})</span>
</h1>
<p class="mt-0.5 max-w-[60rem] text-sm text-ink-700">{{ description }}</p>
<slot />
</div>
</header>
</template>