import { Alert, AlertDescription } from "@/components/ui/alert"; import { Skeleton } from "@/components/ui/skeleton"; import { SessionActivityPanel } from "../components/SessionActivityPanel"; import { SectionCard } from "../components/SectionCard"; import { useWidgetData } from "../hooks/useWidgets"; import type { NowPlayingSession, WidgetInstance } from "../types"; interface Props { widget: WidgetInstance; refreshIntervalMs: number; description?: string; } export function JellyfinNowPlayingWidget({ widget, refreshIntervalMs, description, }: Props) { const { data, isLoading } = useWidgetData(widget.id, refreshIntervalMs); const sessions = data?.data?.sessions as NowPlayingSession[] | undefined; return ( {isLoading && !data ? (
) : data?.error ? ( {data.error} ) : Array.isArray(sessions) ? ( ) : null}
); }