[ui] audioviewer its own component
parent
fbc63d2409
commit
77b7bd7a31
|
@ -1,6 +1,7 @@
|
|||
<script lang="ts">
|
||||
import { useEntity } from "../../lib/entity";
|
||||
import Spinner from "../utils/Spinner.svelte";
|
||||
import AudioViewer from "./blobs/AudioViewer.svelte";
|
||||
import ImageViewer from "./blobs/ImageViewer.svelte";
|
||||
import ModelViewer from "./blobs/ModelViewer.svelte";
|
||||
import TextViewer from "./blobs/TextViewer.svelte";
|
||||
|
@ -40,16 +41,7 @@
|
|||
</div>
|
||||
{/if}
|
||||
{#if audio}
|
||||
{#if imageLoaded != address}
|
||||
<Spinner />
|
||||
{/if}
|
||||
<img
|
||||
src="api/thumb/{address}"
|
||||
alt={address}
|
||||
on:load={() => (imageLoaded = address)}
|
||||
on:error={() => (imageLoaded = address)}
|
||||
/>
|
||||
<audio controls preload="auto" src="api/raw/{address}" />
|
||||
<AudioViewer {address} />
|
||||
{/if}
|
||||
{#if video}
|
||||
{#if imageLoaded != address}
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
<script lang="ts">
|
||||
import Spinner from "../../utils/Spinner.svelte";
|
||||
|
||||
export let address: string;
|
||||
|
||||
let imageLoaded = null;
|
||||
</script>
|
||||
|
||||
<div class="audio">
|
||||
{#if imageLoaded != address}
|
||||
<Spinner />
|
||||
{/if}
|
||||
<img
|
||||
src="api/thumb/{address}"
|
||||
alt={address}
|
||||
on:load={() => (imageLoaded = address)}
|
||||
on:error={() => (imageLoaded = address)}
|
||||
/>
|
||||
<audio controls preload="auto" src="api/raw/{address}" />
|
||||
</div>
|
||||
|
||||
<style lang="scss">
|
||||
.audio {
|
||||
max-width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
</style>
|
Loading…
Reference in New Issue