* 🪢 Wiring up to addTorrent endpoint * 🧲 Added a torrent download sub-panel * 🧲 Fixed the auto-population of search box * 🧲 Added downloads panel * 🧲 Surfacing torrent progress in UI via scheduled job * 🧲 Added visual indicators of torrent progress * 💅🏼 Formatting improvements * 💅🏼 Formatting tweaks to tabs
36 lines
933 B
TypeScript
36 lines
933 B
TypeScript
import React, { ReactElement } from "react";
|
|
import { useParams } from "react-router-dom";
|
|
import { ComicDetail } from "../ComicDetail/ComicDetail";
|
|
import { useQuery } from "@tanstack/react-query";
|
|
import { LIBRARY_SERVICE_BASE_URI } from "../../constants/endpoints";
|
|
import axios from "axios";
|
|
|
|
export const ComicDetailContainer = (): ReactElement | null => {
|
|
const { comicObjectId } = useParams<{ comicObjectId: string }>();
|
|
const {
|
|
data: comicBookDetailData,
|
|
isLoading,
|
|
isError,
|
|
} = useQuery({
|
|
queryKey: ["comicBookMetadata"],
|
|
queryFn: async () =>
|
|
await axios({
|
|
url: `${LIBRARY_SERVICE_BASE_URI}/getComicBookById`,
|
|
method: "POST",
|
|
data: {
|
|
id: comicObjectId,
|
|
},
|
|
}),
|
|
});
|
|
|
|
{
|
|
isError && <>Error</>;
|
|
}
|
|
{
|
|
isLoading && <>Loading...</>;
|
|
}
|
|
return (
|
|
comicBookDetailData?.data && <ComicDetail data={comicBookDetailData.data} />
|
|
);
|
|
};
|