Files
moonwell-web/resources/js/Components/LegalDocument.vue
T

64 lines
3.0 KiB
Vue

<script setup>
import { t } from '../i18n';
defineProps({
eyebrow: { type: String, required: true },
title: { type: String, required: true },
description: { type: String, required: true },
effectiveDate: { type: String, default: '' },
effectiveDateLabel: { type: String, default: t("Дата вступления в силу") },
intro: { type: Array, default: () => [] },
sections: { type: Array, required: true },
});
</script>
<template>
<section class="legal-page wrap">
<header class="legal-hero">
<span class="eyebrow">{{ $t(eyebrow) }}</span>
<h1 class="h-display">{{ $t(title) }}</h1>
<p class="lead">{{ $t(description) }}</p>
<div v-if="effectiveDate" class="legal-effective">
<span>{{ $t(effectiveDateLabel) }}</span>
<strong>{{ $t(effectiveDate) }}</strong>
</div>
</header>
<div class="legal-layout">
<aside class="legal-toc">
<span>{{ $t("Содержание") }}</span>
<a v-for="(section, index) in sections" :key="section.id" :href="`#${section.id}`">
<small>{{ $t(String(index + 1).padStart(2, '0')) }}</small>
{{ $t(section.title) }}
</a>
</aside>
<article class="portal-card legal-document corners">
<div v-if="intro.length" class="legal-intro">
<p v-for="paragraph in intro" :key="paragraph">{{ $t(paragraph) }}</p>
</div>
<section v-for="(section, index) in sections" :id="section.id" :key="section.id">
<span class="legal-section-number">{{ $t(String(index + 1).padStart(2, '0')) }}</span>
<h2 class="h-serif">{{ $t(section.title) }}</h2>
<template v-if="section.blocks">
<template v-for="(block, blockIndex) in section.blocks" :key="blockIndex">
<p v-if="block.type === 'paragraph'">{{ $t(block.text) }}</p>
<h3 v-else-if="block.type === 'subheading'" class="legal-subheading">{{ $t(block.text) }}</h3>
<ul v-else-if="block.type === 'list'">
<li v-for="item in block.items" :key="item">{{ $t(item) }}</li>
</ul>
<p v-else-if="block.type === 'note'" class="legal-note">{{ $t(block.text) }}</p>
</template>
</template>
<template v-else>
<p v-for="paragraph in section.paragraphs" :key="paragraph">{{ $t(paragraph) }}</p>
<ul v-if="section.items">
<li v-for="item in section.items" :key="item">{{ $t(item) }}</li>
</ul>
<p v-if="section.note" class="legal-note">{{ $t(section.note) }}</p>
</template>
</section>
</article>
</div>
</section>
</template>