feat: add Library page to display and manage user podcast subscriptions

This commit is contained in:
Michael committed 2026-04-16 13:34:27 +02:00
1 parent cdc0a4671c
commit 2fbbf70ee0
1 file changed
+2 -10
+2 -10
View File
@@ -42,7 +42,7 @@ export default function Library() {
if (!old || !old.podcasts) return old; if (!old || !old.podcasts) return old;
// Optimistically filter by subscriptionId or _id as fallback // Optimistically filter by subscriptionId or _id as fallback
const filtered = old.podcasts.filter((p: any) => const filtered = old.podcasts.filter((p: any) =>
String(p.subscriptionId || p._id) !== String(id) String(p.subscriptionId || p._id) !== String(podcastId)
); );
return { ...old, podcasts: filtered, count: filtered.length }; return { ...old, podcasts: filtered, count: filtered.length };
} }
@@ -208,7 +208,7 @@ export default function Library() {
</div> </div>
{/* Unsubscribe button */} {/* Unsubscribe button */}
{confirmDeleteId === podcast._id ? ( {confirmDeleteId === (podcast.subscriptionId || podcast._id) ? (
<div className="flex items-center gap-2 mt-auto pt-3 border-t border-light-100"> <div className="flex items-center gap-2 mt-auto pt-3 border-t border-light-100">
<span className="text-xs text-light-600 flex-1">Confirmer le désabonnement ?</span> <span className="text-xs text-light-600 flex-1">Confirmer le désabonnement ?</span>
<button <button
@@ -244,14 +244,6 @@ export default function Library() {
</div> </div>
)} )}
</main> </main>
{/* Confirm modal overlay (backdrop click to cancel) */}
{confirmDeleteId && (
<div
className="fixed inset-0 bg-black/20 z-40"
onClick={() => setConfirmDeleteId(null)}
/>
)}
</div> </div>
); );
} }