auth + player
This commit is contained in:
@@ -2,13 +2,36 @@
|
||||
// @ts-nocheck
|
||||
import { Label } from '$lib/components/ui/label';
|
||||
import { Button } from '$lib/components/ui/button';
|
||||
import Player from '$lib/components/organisms/player.svelte';
|
||||
import { onMount } from 'svelte';
|
||||
import { PlayIcon, Loader } from 'lucide-svelte';
|
||||
|
||||
let script = "";
|
||||
|
||||
let opened = false;
|
||||
let pods = [];
|
||||
onMount(async () => {
|
||||
let res = await (await fetch("/")).json();
|
||||
console.log(res);
|
||||
script = res.script;
|
||||
|
||||
res = await (await fetch("/api/pods")).json();
|
||||
console.log(res);
|
||||
pods = res.pods;
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
{#if opened}
|
||||
<Player script={script} on:close={() => opened=false} />
|
||||
{/if}
|
||||
|
||||
<div>
|
||||
<Label>Your Latest Podcast</Label>
|
||||
<Button class="flex w-full flex-row justify-start rounded text-left" variant="secondary">
|
||||
<div class="items-center justify-center rounded-lg p-2">
|
||||
<img src="/icons/play.svg" width={16} height={16} alt="" />
|
||||
<Button class="flex w-full flex-row justify-start rounded text-left" variant="secondary" on:click={() => opened = true}>
|
||||
<div class="items-center justify-center rounded-lg p-2 pl-0">
|
||||
<PlayIcon class="h-4 w-4" />
|
||||
</div>
|
||||
<div>
|
||||
<h3 class="text-md">Your Daily Pod</h3>
|
||||
@@ -16,17 +39,17 @@
|
||||
</div>
|
||||
</Button>
|
||||
<Label>Your Newsletters</Label>
|
||||
<div class="overflow-scroll">
|
||||
{#each [5, 4, 3, 2, 1] as _}
|
||||
<Button class="flex w-full flex-row justify-start rounded text-left mt-4" variant="secondary">
|
||||
<div class="items-center justify-center rounded-lg p-2">
|
||||
<img src="/icons/play.svg" width={16} height={16} alt="" />
|
||||
<div class="overflow-x-scroll scrollbars-hidden">
|
||||
{#each pods as pod, i}
|
||||
<Button class="mt-4 flex w-full flex-row justify-start rounded text-left" variant="secondary">
|
||||
<div class="items-center justify-center rounded-lg p-2 pl-0">
|
||||
<PlayIcon class="h-4 w-4" />
|
||||
</div>
|
||||
<div>
|
||||
<h3 class="text-md">Your Daily Pod</h3>
|
||||
<p class="text-sm text-muted-foreground">January 18th, 2024</p>
|
||||
<h3 class="text-md">{pod.title}</h3>
|
||||
<p class="text-sm text-muted-foreground">{new Date(pod.date).toLocaleDateString('de')}</p>
|
||||
</div>
|
||||
</Button>
|
||||
{/each}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user