summaryrefslogtreecommitdiff
path: root/packages/frontend/src/components/page/page.section.vue
blob: e3d26d924f94d330c97a5f5608c2281170124a37 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<!--
SPDX-FileCopyrightText: syuilo and misskey-project
SPDX-License-Identifier: AGPL-3.0-only
-->

<template>
<section>
	<component
		:is="'h' + h"
		:class="{
			'h2': h === 2,
			'h3': h === 3,
			'h4': h === 4,
		}"
	>
		{{ block.title }}
	</component>

	<div class="_gaps">
		<XBlock v-for="child in block.children" :key="child.id" :page="page" :block="child" :h="h + 1"/>
	</div>
</section>
</template>

<script lang="ts" setup>
import { defineAsyncComponent } from 'vue';
import * as Misskey from 'misskey-js';

const XBlock = defineAsyncComponent(() => import('./page.block.vue'));

defineProps<{
	block: Misskey.entities.PageBlock,
	h: number,
	page: Misskey.entities.Page,
}>();
</script>

<style lang="scss" module>
.h2 {
	font-size: 1.35em;
	margin: 0 0 0.5em 0;
}

.h3 {
	font-size: 1em;
	margin: 0 0 0.5em 0;
}

.h4 {
	font-size: 1em;
	margin: 0 0 0.5em 0;
}
</style>