2024-08-01 18:09:35 +02:00
|
|
|
<script lang="ts">
|
|
|
|
|
import type { Snippet } from "svelte";
|
2024-08-04 16:15:09 +02:00
|
|
|
import { md } from "$lib/utils";
|
2024-08-01 18:09:35 +02:00
|
|
|
|
2024-08-03 18:07:27 +02:00
|
|
|
const {
|
|
|
|
|
id,
|
|
|
|
|
title,
|
|
|
|
|
children,
|
|
|
|
|
fullPreview = false,
|
|
|
|
|
previewContent
|
|
|
|
|
} = $props<{
|
2024-08-01 18:09:35 +02:00
|
|
|
id: string;
|
|
|
|
|
title: string;
|
|
|
|
|
children: Snippet;
|
2024-08-03 18:07:27 +02:00
|
|
|
fullPreview?: boolean;
|
2024-08-01 18:09:35 +02:00
|
|
|
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-05 19:33:35 +02:00
|
|
|
<a href="/website/{id}/collaborators">Collaborators</a>
|
2024-08-03 18:07:27 +02:00
|
|
|
<a href="/website/{id}/publish">Publish</a>
|
2024-08-02 15:33:18 +02:00
|
|
|
</nav>
|
2024-08-01 18:09:35 +02:00
|
|
|
|
|
|
|
|
{@render children()}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="preview">
|
2024-08-03 18:07:27 +02:00
|
|
|
{#if fullPreview}
|
2024-08-04 16:15:09 +02:00
|
|
|
<iframe
|
|
|
|
|
src="http://localhost:5173/user-websites/e6710116-f2b7-4318-82de-35a25d22ed2e/0015130f-3024-402b-8421-aaee4a6f0890/index.html"
|
|
|
|
|
title="Preview"
|
|
|
|
|
></iframe>
|
2024-08-03 18:07:27 +02:00
|
|
|
{:else}
|
|
|
|
|
{@html md.render(previewContent)}
|
|
|
|
|
{/if}
|
2024-08-01 18:09:35 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
.operations,
|
|
|
|
|
.preview {
|
|
|
|
|
padding: 1rem;
|
2024-08-03 13:49:41 +02:00
|
|
|
overflow-y: auto;
|
2024-08-01 18:09:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.operations {
|
2024-08-02 15:33:18 +02:00
|
|
|
border-inline-end: var(--border-primary);
|
2024-08-01 18:09:35 +02:00
|
|
|
}
|
|
|
|
|
|
2024-08-02 15:33:18 +02:00
|
|
|
.operations__nav {
|
|
|
|
|
margin-block: 1rem 2rem;
|
2024-08-03 18:07:27 +02:00
|
|
|
display: flex;
|
|
|
|
|
gap: 1rem;
|
2024-08-02 15:33:18 +02:00
|
|
|
overflow-x: auto;
|
|
|
|
|
}
|
|
|
|
|
|
2024-08-01 18:09:35 +02:00
|
|
|
.preview {
|
2024-08-03 13:49:41 +02:00
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
gap: 1rem;
|
2024-08-01 18:09:35 +02:00
|
|
|
}
|
2024-08-03 18:07:27 +02:00
|
|
|
|
|
|
|
|
iframe {
|
|
|
|
|
inline-size: 100%;
|
|
|
|
|
block-size: 100%;
|
|
|
|
|
border: var(--border-primary);
|
|
|
|
|
}
|
2024-08-01 18:09:35 +02:00
|
|
|
</style>
|