spotifyplaylistarchive.com/src/layouts/PlaylistPageTab.astro

62 lines
1.6 KiB
Plaintext
Raw Normal View History

---
import BaseLayout from './BaseLayout.astro';
import type { PlaylistSnapshot } from '../models/playlist-snapshot';
interface Props {
playlist: PlaylistSnapshot | null;
title: string;
description: string;
2023-01-18 22:21:17 +01:00
errorOccurred: boolean;
}
2023-01-18 22:21:17 +01:00
const { playlistId } = Astro.params;
const { playlist, title, description, errorOccurred } = Astro.props as Props;
---
<BaseLayout title={title} description={description}>
2023-01-09 23:42:44 +01:00
<div
class:list={[
'px-5 text-center flex flex-col gap-5 items-center',
playlist ? 'mt-[5.5rem]' : 'w-screen h-screen justify-center'
2023-01-09 23:42:44 +01:00
]}
>
{
2023-01-18 22:21:17 +01:00
!errorOccurred && playlist ? (
<h1 class="font-bold md:text-4xl text-3xl">
<a href={playlist.url} target="_blank" rel="noopener noreferrer">
{title}
</a>
by
<a
href={playlist.owner.url}
target="_blank"
rel="noopener noreferrer"
>
{playlist.owner.name}
</a>
</h1>
<div class="tabs mb-2">
2023-01-18 22:21:17 +01:00
<a class="tab text-base" href={`/playlists/${playlistId}/snapshots`}>
<i class="fa-solid fa-calendar mr-3" />
Browse snapshots
</a>
<a class="tab text-base">
<i class="fa-solid fa-plus-minus mr-3" />
Compare snapshots
</a>
<a class="tab text-base">
<i class="fa-solid fa-chart-line mr-3" />
Show statistics
</a>
</div>
<slot />
) : (
<div class="alert alert-error max-w-xs justify-center shadow-lg">
<span>{description}</span>
</div>
)
}
</div>
</BaseLayout>