import { FunctionComponent, useMemo } from "react"; import { Link } from "react-router-dom"; import { Anchor, Badge, Group } from "@mantine/core"; import { faSearch } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { ColumnDef } from "@tanstack/react-table"; import { useMovieAction, useMovieSubtitleModification, useMovieWantedPagination, } from "@/apis/hooks"; import Language from "@/components/bazarr/Language"; import { task, TaskGroup } from "@/modules/task"; import WantedView from "@/pages/views/WantedView"; import { BuildKey } from "@/utilities"; const WantedMoviesView: FunctionComponent = () => { const { download } = useMovieSubtitleModification(); const columns = useMemo[]>( () => [ { header: "Name", accessorKey: "title", cell: ({ row: { original: { title, radarrId }, }, }) => { const target = `/movies/${radarrId}`; return ( {title} ); }, }, { header: "Missing", accessorKey: "missing_subtitles", cell: ({ row: { original: { radarrId, missing_subtitles: missingSubtitles }, }, }) => { return ( {missingSubtitles.map((item, idx) => ( } key={BuildKey(idx, item.code2)} style={{ cursor: "pointer" }} onClick={() => { task.create( item.name, TaskGroup.SearchSubtitle, download.mutateAsync, { radarrId, form: { language: item.code2, hi: item.hi, forced: item.forced, }, }, ); }} > ))} ); }, }, ], [download], ); const { mutateAsync } = useMovieAction(); const query = useMovieWantedPagination(); return ( mutateAsync({ action: "search-wanted" })} > ); }; export default WantedMoviesView;