diff --git a/src/client/components/ComicDetail.tsx b/src/client/components/ComicDetail.tsx
index 9835712..e27c3f3 100644
--- a/src/client/components/ComicDetail.tsx
+++ b/src/client/components/ComicDetail.tsx
@@ -5,37 +5,30 @@ import React, {
ReactElement,
useContext,
} from "react";
-
+import { useDispatch, useSelector } from "react-redux";
import { useParams } from "react-router-dom";
import Card from "./Carda";
import { ComicVineMatchPanel } from "./ComicDetail/ComicVineMatchPanel";
import { VolumeInformation } from "./ComicDetail/Tabs/VolumeInformation";
import { ComicVineDetails } from "./ComicDetail/ComicVineDetails";
import { RawFileDetails } from "./ComicDetail/RawFileDetails";
+import { ArchiveOperations } from "./ComicDetail/Tabs/ArchiveOperations";
import AcquisitionPanel from "./ComicDetail/AcquisitionPanel";
import DownloadsPanel from "./ComicDetail/DownloadsPanel";
-import SlidingPane from "react-sliding-pane";
-import Select, { components } from "react-select";
+import { Menu } from "./ComicDetail/ActionMenu/Menu";
+
+import { isEmpty, isUndefined, isNil } from "lodash";
+import { RootState } from "threetwo-ui-typings";
+
+import { getComicBookDetailById } from "../actions/comicinfo.actions";
import "react-sliding-pane/dist/react-sliding-pane.css";
import "react-loader-spinner/dist/loader/css/react-spinner-loader.css";
import Loader from "react-loader-spinner";
-import { isEmpty, isUndefined, isNil } from "lodash";
-import { RootState } from "threetwo-ui-typings";
-import { fetchComicVineMatches } from "../actions/fileops.actions";
-import {
- getComicBookDetailById,
- extractComicArchive,
-} from "../actions/comicinfo.actions";
+import SlidingPane from "react-sliding-pane";
+
+import { escapePoundSymbol } from "../shared/utils/formatting.utils";
-const prettyBytes = require("pretty-bytes");
-import { DnD } from "./DnD";
-import { useDispatch, useSelector } from "react-redux";
-import {
- removeLeadingPeriod,
- escapePoundSymbol,
-} from "../shared/utils/formatting.utils";
-import Sticky from "react-stickynode";
import { IMPORT_SERVICE_HOST } from "../constants/endpoints";
import { getSettings } from "../actions/settings.actions";
import { AirDCPPSocketContext } from "../context/AirDCPPSocket";
@@ -69,12 +62,6 @@ export const ComicDetail = ({}: ComicDetailProps): ReactElement => {
const comicBookDetailData = useSelector(
(state: RootState) => state.comicInfo.comicBookDetail,
);
- const isComicBookExtractionInProgress = useSelector(
- (state: RootState) => state.fileOps.comicBookExtractionInProgress,
- );
- const extractedComicBookArchive = useSelector(
- (state: RootState) => state.fileOps.extractedComicBookArchive,
- );
const { comicObjectId } = useParams<{ comicObjectId: string }>();
const userSettings = useSelector((state: RootState) => state.settings.data);
@@ -98,23 +85,6 @@ export const ComicDetail = ({}: ComicDetailProps): ReactElement => {
}
}, [userSettings]);
- const unpackComicArchive = useCallback(() => {
- dispatch(
- extractComicArchive(
- comicBookDetailData.rawFileDetails.containedIn +
- "/" +
- comicBookDetailData.rawFileDetails.name +
- comicBookDetailData.rawFileDetails.extension,
- {
- extractTarget: "book",
- targetExtractionFolder:
- "./userdata/expanded/" + comicBookDetailData.rawFileDetails.name,
- extractionMode: "all",
- },
- ),
- );
- }, [dispatch, comicBookDetailData]);
-
// sliding panel init
const contentForSlidingPanel = {
CVMatches: {
@@ -153,12 +123,6 @@ export const ComicDetail = ({}: ComicDetailProps): ReactElement => {
},
};
- const openDrawerWithCVMatches = useCallback(() => {
- dispatch(fetchComicVineMatches(comicBookDetailData));
- setSlidingPanelContentId("CVMatches");
- setVisible(true);
- }, [dispatch, comicBookDetailData]);
-
const [active, setActive] = useState(1);
const isComicBookMetadataAvailable =
@@ -180,47 +144,7 @@ export const ComicDetail = ({}: ComicDetailProps): ReactElement => {
id: 2,
icon: ,
name: "Archive Operations",
- content: (
-
-
-
-
- {!isEmpty(extractedComicBookArchive) ? (
-
- ) : null}
-
- {!isEmpty(extractedComicBookArchive) ? (
-
-
-
-
- {extractedComicBookArchive.length} pages
-
-
-
-
-
- ) : null}
-
-
- ),
+ content: ,
},
{
id: 3,
@@ -306,42 +230,6 @@ export const ComicDetail = ({}: ComicDetailProps): ReactElement => {
comicBookTitle = comicBookDetailData.sourcedMetadata.comicvine.name;
}
- // Actions menu options and handler
- const CVMatchLabel = (
-
- Match on ComicVine
-
- );
-
- const editLabel = (
-
- Edit Metadata
-
- );
- const deleteLabel = (
-
- Delete Comic
-
- );
- const Placeholder = (props) => {
- return ;
- };
- const actionOptions = [
- { value: "match-on-comic-vine", label: CVMatchLabel },
- { value: "edit-metdata", label: editLabel },
- { value: "delete-comic", label: deleteLabel },
- ];
-
- const handleActionSelection = (action) => {
- switch (action.value) {
- case "match-on-comic-vine":
- openDrawerWithCVMatches();
- break;
- default:
- console.log("No valid action selected.");
- break;
- }
- };
return (
@@ -373,19 +261,9 @@ export const ComicDetail = ({}: ComicDetailProps): ReactElement => {
{/* action dropdown */}
-
diff --git a/src/client/components/ComicDetail/ActionMenu/Menu.tsx b/src/client/components/ComicDetail/ActionMenu/Menu.tsx
new file mode 100644
index 0000000..8a25b79
--- /dev/null
+++ b/src/client/components/ComicDetail/ActionMenu/Menu.tsx
@@ -0,0 +1,70 @@
+import React, { ReactElement, useCallback } from "react";
+import { useSelector, useDispatch } from "react-redux";
+import Select, { components } from "react-select";
+import { fetchComicVineMatches } from "../../../actions/fileops.actions";
+
+export const Menu = (props): ReactElement => {
+ const { data } = props;
+ const { setSlidingPanelContentId, setVisible } = props.handlers;
+ const dispatch = useDispatch();
+ const openDrawerWithCVMatches = useCallback(() => {
+ dispatch(fetchComicVineMatches(data));
+ setSlidingPanelContentId("CVMatches");
+ setVisible(true);
+ }, [dispatch, data]);
+ // Actions menu options and handler
+ const CVMatchLabel = (
+
+ Match on ComicVine
+
+ );
+
+ const editLabel = (
+
+ Edit Metadata
+
+ );
+ const deleteLabel = (
+
+ Delete Comic
+
+ );
+ const Placeholder = (props) => {
+ return ;
+ };
+ const actionOptions = [
+ { value: "match-on-comic-vine", label: CVMatchLabel },
+ { value: "edit-metdata", label: editLabel },
+ { value: "delete-comic", label: deleteLabel },
+ ];
+
+ const handleActionSelection = (action) => {
+ switch (action.value) {
+ case "match-on-comic-vine":
+ openDrawerWithCVMatches();
+ break;
+ default:
+ console.log("No valid action selected.");
+ break;
+ }
+ };
+
+ return (
+