Files
archtika/web-app/src/lib/components/WebsiteEditor.svelte

57 lines
968 B
Svelte
Raw Normal View History

2024-08-01 18:09:35 +02:00
<script lang="ts">
import type { Snippet } from "svelte";
const { id, title, children, previewContent } = $props<{
id: string;
title: string;
children: Snippet;
previewContent: string;
}>();
</script>
<div class="operations">
<h1>{title}</h1>
2024-08-02 15:33:18 +02:00
<nav class="operations__nav">
2024-08-01 18:09:35 +02:00
<a href="/website/{id}">Settings</a>
<a href="/website/{id}/articles">Articles</a>
2024-08-02 15:33:18 +02:00
</nav>
2024-08-01 18:09:35 +02:00
{@render children()}
</div>
<div class="preview">
{@html previewContent}
</div>
<style>
.operations,
.preview {
padding: 1rem;
min-inline-size: 15rem;
block-size: 100%;
}
.operations {
inline-size: 50%;
2024-08-02 15:33:18 +02:00
border-inline-end: var(--border-primary);
2024-08-01 18:09:35 +02:00
resize: horizontal;
overflow-y: auto;
}
2024-08-02 15:33:18 +02:00
.operations__nav {
margin-block: 1rem 2rem;
}
.operations__nav > a {
display: inline-block;
padding-inline: 0.5rem;
padding-block: 0.25rem;
overflow-x: auto;
}
2024-08-01 18:09:35 +02:00
.preview {
flex-grow: 1;
}
</style>