2024-08-03 18:07:27 +02:00
|
|
|
<script lang="ts">
|
|
|
|
|
import { enhance } from "$app/forms";
|
|
|
|
|
import WebsiteEditor from "$lib/components/WebsiteEditor.svelte";
|
2024-08-05 19:33:35 +02:00
|
|
|
import SuccessOrError from "$lib/components/SuccessOrError.svelte";
|
2024-08-05 14:38:44 +02:00
|
|
|
import type { ActionData, PageServerData } from "./$types";
|
2024-08-03 18:07:27 +02:00
|
|
|
|
2024-08-20 19:17:05 +02:00
|
|
|
const { data, form }: { data: PageServerData; form: ActionData } = $props();
|
2024-08-03 18:07:27 +02:00
|
|
|
</script>
|
|
|
|
|
|
2024-08-05 19:33:35 +02:00
|
|
|
<SuccessOrError success={form?.success} message={form?.message} />
|
|
|
|
|
|
2024-08-03 18:07:27 +02:00
|
|
|
<WebsiteEditor
|
|
|
|
|
id={data.website.id}
|
|
|
|
|
title={data.website.title}
|
2024-08-10 22:20:57 +02:00
|
|
|
previewContent={data.websitePreviewUrl}
|
2024-08-03 18:07:27 +02:00
|
|
|
fullPreview={true}
|
|
|
|
|
>
|
|
|
|
|
<section>
|
|
|
|
|
<h2>Publish website</h2>
|
|
|
|
|
|
|
|
|
|
<p>
|
|
|
|
|
The preview area on this page allows you to see exactly how your website will look when it is
|
|
|
|
|
is published. If you are happy with the results, click the button below and your website will
|
|
|
|
|
be published on the Internet.
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
<form method="POST" action="?/publishWebsite" use:enhance>
|
2024-08-04 17:46:41 +02:00
|
|
|
<input type="hidden" name="website-overview" value={JSON.stringify(data.websiteOverview)} />
|
2024-08-03 18:07:27 +02:00
|
|
|
<button type="submit">Publish</button>
|
|
|
|
|
</form>
|
|
|
|
|
</section>
|
|
|
|
|
</WebsiteEditor>
|