Add Showy Homepage dashboard widget
Homepage widget with totals, library, and watchlist mappings. Displays total entries, collections, favorites, library breakdown (movies/series), and watchlist breakdown (movies/series).
This commit is contained in:
1 parent
63aca7e7b8
commit
e660b1ec87
3 files changed
+149
No files matched your search
@@ -0,0 +1,47 @@
|
||||
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>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user