diff --git a/package.json b/package.json index 08c5823..27a81cd 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "siteforge", "private": true, - "version": "1.1.5", + "version": "1.1.6", "type": "module", "scripts": { "dev": "vite", diff --git a/src/App.tsx b/src/App.tsx index e31370b..105ce29 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1578,6 +1578,27 @@ function FinishedSeriesPage({ content }: { content: SiteContent }) { ) } +function LatestEpisodePlayer({ content }: { content: SiteContent }) { + const [audioUrl, setAudioUrl] = useState('') + const [title, setTitle] = useState('') + + useEffect(() => { + fetch('/api/episodes') + .then(r => r.ok ? r.json() : Promise.reject()) + .then((data: { episodes?: { title: string; audioUrl: string }[] }) => { + const latest = data.episodes?.[0] + if (latest?.audioUrl) { + setAudioUrl(latest.audioUrl) + setTitle(latest.title) + } + }) + .catch(() => {}) + }, []) + + if (!audioUrl) return
+ return