teoldalad/lib/components/bio/widgets/TwitchLive.svelte
2024-03-13 00:30:45 +01:00

17 lines
796 B
Svelte

<script lang="ts">
import GenericSite from './types/GenericSite.svelte';
import InteractivePanel from '../elements/InteractivePanel.svelte';
import WidgetRenderContainer from '../elements/WidgetRenderContainer.svelte';
export let data: WidgetTwitchLive;
export let preview: WidgetPreviewTwitchLive | undefined = undefined;
export let nonInteractive: boolean = false;
export let handle: boolean = false;
export let isPreview: boolean = false;
</script>
<InteractivePanel preview={isPreview} title="Twitch Live" url={!nonInteractive ? data.url : undefined} {handle}>
<WidgetRenderContainer hasPreview={preview != null}>
<GenericSite thumbnail={preview?.thumbnail} title={preview?.channel} description={preview?.description} />
</WidgetRenderContainer>
</InteractivePanel>