chore: nowplaying interactivity
This commit is contained in:
parent
463a26defc
commit
42237f57cb
3 changed files with 47 additions and 26 deletions
|
@ -1,10 +1,20 @@
|
|||
---
|
||||
import NowPlaying from "@components/blocks/NowPlaying.astro";
|
||||
import NowPlaying from "@components/blocks/NowPlaying.jsx";
|
||||
import { fetchNowPlaying } from "@utils/data/nowPlaying.js";
|
||||
|
||||
const { intro } = Astro.props;
|
||||
|
||||
let nowPlayingStaticContent = "Nothing playing.";
|
||||
|
||||
if (import.meta.env.MODE === "development") {
|
||||
const nowPlayingData = await fetchNowPlaying();
|
||||
nowPlayingStaticContent = nowPlayingData.content;
|
||||
}
|
||||
---
|
||||
|
||||
<article class="intro">
|
||||
<div set:html={intro} />
|
||||
<p class="music"><NowPlaying /></p>
|
||||
<p class="music">
|
||||
<NowPlaying staticContent={nowPlayingStaticContent} client:load />
|
||||
</p>
|
||||
</article>
|
||||
|
|
Reference in a new issue