|
|
@ -18,6 +18,8 @@ import { useLanguageProfileBy } from "@/utilities/languages";
|
|
|
|
import {
|
|
|
|
import {
|
|
|
|
faAdjust,
|
|
|
|
faAdjust,
|
|
|
|
faBriefcase,
|
|
|
|
faBriefcase,
|
|
|
|
|
|
|
|
faCircleChevronDown,
|
|
|
|
|
|
|
|
faCircleChevronRight,
|
|
|
|
faCloudUploadAlt,
|
|
|
|
faCloudUploadAlt,
|
|
|
|
faHdd,
|
|
|
|
faHdd,
|
|
|
|
faSearch,
|
|
|
|
faSearch,
|
|
|
@ -28,11 +30,23 @@ import { Container, Group, Stack } from "@mantine/core";
|
|
|
|
import { Dropzone } from "@mantine/dropzone";
|
|
|
|
import { Dropzone } from "@mantine/dropzone";
|
|
|
|
import { useDocumentTitle } from "@mantine/hooks";
|
|
|
|
import { useDocumentTitle } from "@mantine/hooks";
|
|
|
|
import { showNotification } from "@mantine/notifications";
|
|
|
|
import { showNotification } from "@mantine/notifications";
|
|
|
|
import { FunctionComponent, useCallback, useMemo, useRef } from "react";
|
|
|
|
import {
|
|
|
|
|
|
|
|
FunctionComponent,
|
|
|
|
|
|
|
|
useCallback,
|
|
|
|
|
|
|
|
useMemo,
|
|
|
|
|
|
|
|
useRef,
|
|
|
|
|
|
|
|
useState,
|
|
|
|
|
|
|
|
} from "react";
|
|
|
|
import { Navigate, useParams } from "react-router-dom";
|
|
|
|
import { Navigate, useParams } from "react-router-dom";
|
|
|
|
import Table from "./table";
|
|
|
|
import Table from "./table";
|
|
|
|
|
|
|
|
|
|
|
|
const SeriesEpisodesView: FunctionComponent = () => {
|
|
|
|
const SeriesEpisodesView: FunctionComponent = () => {
|
|
|
|
|
|
|
|
const [state, setState] = useState({
|
|
|
|
|
|
|
|
expand: false,
|
|
|
|
|
|
|
|
buttonText: "Expand All",
|
|
|
|
|
|
|
|
initial: true,
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
const params = useParams();
|
|
|
|
const params = useParams();
|
|
|
|
const id = Number.parseInt(params.id as string);
|
|
|
|
const id = Number.parseInt(params.id as string);
|
|
|
|
|
|
|
|
|
|
|
@ -94,6 +108,12 @@ const SeriesEpisodesView: FunctionComponent = () => {
|
|
|
|
return <Navigate to={RouterNames.NotFound}></Navigate>;
|
|
|
|
return <Navigate to={RouterNames.NotFound}></Navigate>;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const toggleState = () => {
|
|
|
|
|
|
|
|
state.expand
|
|
|
|
|
|
|
|
? setState({ expand: false, buttonText: "Expand All", initial: false })
|
|
|
|
|
|
|
|
: setState({ expand: true, buttonText: "Collapse All", initial: false });
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<Container px={0} fluid>
|
|
|
|
<Container px={0} fluid>
|
|
|
|
<QueryOverlay result={seriesQuery}>
|
|
|
|
<QueryOverlay result={seriesQuery}>
|
|
|
@ -189,12 +209,22 @@ const SeriesEpisodesView: FunctionComponent = () => {
|
|
|
|
>
|
|
|
|
>
|
|
|
|
Edit Series
|
|
|
|
Edit Series
|
|
|
|
</Toolbox.Button>
|
|
|
|
</Toolbox.Button>
|
|
|
|
|
|
|
|
<Toolbox.Button
|
|
|
|
|
|
|
|
icon={state.expand ? faCircleChevronRight : faCircleChevronDown}
|
|
|
|
|
|
|
|
onClick={() => {
|
|
|
|
|
|
|
|
toggleState();
|
|
|
|
|
|
|
|
}}
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
{state.buttonText}
|
|
|
|
|
|
|
|
</Toolbox.Button>
|
|
|
|
</Group>
|
|
|
|
</Group>
|
|
|
|
</Toolbox>
|
|
|
|
</Toolbox>
|
|
|
|
<Stack>
|
|
|
|
<Stack>
|
|
|
|
<ItemOverview item={series ?? null} details={details}></ItemOverview>
|
|
|
|
<ItemOverview item={series ?? null} details={details}></ItemOverview>
|
|
|
|
<QueryOverlay result={episodesQuery}>
|
|
|
|
<QueryOverlay result={episodesQuery}>
|
|
|
|
<Table
|
|
|
|
<Table
|
|
|
|
|
|
|
|
expand={state.expand}
|
|
|
|
|
|
|
|
initial={state.initial}
|
|
|
|
episodes={episodes ?? null}
|
|
|
|
episodes={episodes ?? null}
|
|
|
|
profile={profile}
|
|
|
|
profile={profile}
|
|
|
|
disabled={hasTask || !series || series.profileId === null}
|
|
|
|
disabled={hasTask || !series || series.profileId === null}
|
|
|
|