s3-share/web/opener/Text.svelte

19 lines
336 B
Svelte
Raw Normal View History

2022-05-10 14:01:07 +00:00
<script lang="ts">
2022-05-10 20:37:30 +00:00
import { onMount } from "svelte";
export let contentType: string;
export let filename: string;
export let slug: string;
2022-05-10 14:01:07 +00:00
2022-05-10 20:37:30 +00:00
let content = "";
onMount(async () => {
const res = await fetch(`/s/${slug}`);
content = await res.text();
});
2022-05-10 14:01:07 +00:00
</script>
<div>
2022-05-10 20:37:30 +00:00
Text opener
<pre><code>{ content }</code></pre>
2022-05-10 14:01:07 +00:00
</div>