Homepage widget with totals, library, and watchlist mappings. Displays total entries, collections, favorites, library breakdown (movies/series), and watchlist breakdown (movies/series).
48 lines
1.6 KiB
React
48 lines
1.6 KiB
React
import Block from "components/services/widget/block";
|
|
import Container from "components/services/widget/container";
|
|
|
|
import useWidgetAPI from "utils/proxy/use-widget-api";
|
|
|
|
export default function Component({ service }) {
|
|
const { widget } = service;
|
|
|
|
const { data: showyStats, error: showyStatsError } = useWidgetAPI(
|
|
widget,
|
|
"stats",
|
|
);
|
|
|
|
if (showyStatsError) {
|
|
return <Container service={service} error={showyStatsError} />;
|
|
}
|
|
|
|
if (!showyStats) {
|
|
return (
|
|
<Container service={service}>
|
|
{/* <Block label="Total Entries" />*/}
|
|
<Block label="Library" />
|
|
{/* <Block label="Library Movies" />
|
|
<Block label="Library Series" />*/}
|
|
<Block label="Watchlist" />
|
|
{/* <Block label="Watchlist Movies" />
|
|
<Block label="Watchlist Series" />
|
|
<Block label="Collections" />
|
|
<Block label="Favorites" />*/}
|
|
</Container>
|
|
);
|
|
}
|
|
|
|
return (
|
|
<Container service={service}>
|
|
{/* <Block label="Total Entries" value={showyStats.totalEntries} />*/}
|
|
<Block label="Library" value={showyStats.library} />
|
|
{/* <Block label="Library Movies" value={showyStats.libraryMovies} />*/}
|
|
{/* <Block label="Library Series" value={showyStats.librarySeries} />*/}
|
|
<Block label="Watchlist" value={showyStats.watchlist} />
|
|
{/* <Block label="Watchlist Movies" value={showyStats.watchlistMovies} />*/}
|
|
{/* <Block label="Watchlist Series" value={showyStats.watchlistSeries} />*/}
|
|
{/* <Block label="Collections" value={showyStats.collections} />*/}
|
|
{/* <Block label="Favorites" value={showyStats.favorits} />*/}
|
|
</Container>
|
|
);
|
|
}
|