import { FunctionComponent, useMemo } from "react"; import { Link } from "react-router-dom"; import { Anchor, Container, Progress } from "@mantine/core"; import { useDocumentTitle } from "@mantine/hooks"; import { faBookmark as farBookmark } from "@fortawesome/free-regular-svg-icons"; import { faBookmark, faWrench } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { ColumnDef } from "@tanstack/react-table"; import { useSeriesModification, useSeriesPagination } from "@/apis/hooks"; import { Action } from "@/components"; import LanguageProfileName from "@/components/bazarr/LanguageProfile"; import { ItemEditModal } from "@/components/forms/ItemEditForm"; import { useModals } from "@/modules/modals"; import ItemView from "@/pages/views/ItemView"; const SeriesView: FunctionComponent = () => { const mutation = useSeriesModification(); const query = useSeriesPagination(); const modals = useModals(); const columns = useMemo[]>( () => [ { id: "monitored", cell: ({ row: { original: { monitored }, }, }) => ( ), }, { header: "Name", accessorKey: "title", cell: ({ row: { original } }) => { const target = `/series/${original.sonarrSeriesId}`; return ( {original.title} ); }, }, { header: "Languages Profile", accessorKey: "profileId", cell: ({ row: { original } }) => { return ( ); }, }, { header: "Episodes", accessorKey: "episodeFileCount", cell: (row) => { const { episodeFileCount, episodeMissingCount, profileId, title } = row.row.original; const label = `${episodeFileCount - episodeMissingCount}/${episodeFileCount}`; return ( {label} {episodeMissingCount === episodeFileCount && ( {label} )} ); }, }, { id: "sonarrSeriesId", cell: ({ row: { original } }) => { return ( modals.openContextModal( ItemEditModal, { mutation, item: original, }, { title: original.title, }, ) } icon={faWrench} > ); }, }, ], [mutation, modals], ); useDocumentTitle("Series - Bazarr"); return ( ); }; export default SeriesView;