mirror of
https://github.com/kunkunsh/kunkun.git
synced 2025-04-11 17:29:44 +00:00

the worker package initialize comlink API's and cause trouble for regular website when ui package is imported
29 lines
633 B
Svelte
29 lines
633 B
Svelte
<script lang="ts">
|
|
import { MarkdownSchema } from "@kksh/api/models"
|
|
import { Button } from "@kksh/svelte5"
|
|
import { ArrowLeftIcon } from "lucide-svelte"
|
|
import Markdown from "./Markdown.svelte"
|
|
|
|
const {
|
|
markdownViewContent,
|
|
onGoBack
|
|
}: {
|
|
markdownViewContent: MarkdownSchema
|
|
onGoBack?: () => void
|
|
} = $props()
|
|
</script>
|
|
|
|
<svelte:window
|
|
on:keydown={(e) => {
|
|
if (e.key === "Escape") {
|
|
onGoBack?.()
|
|
}
|
|
}}
|
|
/>
|
|
<Button class="fixed left-2 top-2" onclick={onGoBack} variant="outline" size="icon">
|
|
<ArrowLeftIcon />
|
|
</Button>
|
|
<main class="container my-5">
|
|
<Markdown markdown={markdownViewContent.content} />
|
|
</main>
|