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 React, { FunctionComponent, useMemo } from "react"; import { Badge } from "react-bootstrap"; import { Link } from "react-router-dom"; import { Column } from "react-table"; import { movieUpdateAll, movieUpdateByRange } from "../../@redux/actions"; import { useLanguageProfiles, useMovieEntities } from "../../@redux/hooks"; import { useReduxAction } from "../../@redux/hooks/base"; import { MoviesApi } from "../../apis"; import { ActionBadge, LanguageText, TextPopover } from "../../components"; import { BuildKey } from "../../utilities"; import BaseItemView from "../generic/BaseItemView"; interface Props {} const MovieView: FunctionComponent = () => { const movies = useMovieEntities(); const loader = useReduxAction(movieUpdateByRange); const profiles = useLanguageProfiles(); const columns: Column[] = useMemo[]>( () => [ { accessor: "monitored", selectHide: true, Cell: ({ value }) => ( ), }, { Header: "Name", accessor: "title", className: "text-nowrap", Cell: ({ row, value, isSelecting: select }) => { if (select) { return value; } else { const target = `/movies/${row.original.radarrId}`; return ( {value} ); } }, }, { Header: "Audio", accessor: "audio_language", Cell: (row) => { return row.value.map((v) => ( {v.name} )); }, }, { Header: "Languages Profile", accessor: "profileId", Cell: ({ value }) => { return profiles?.find((v) => v.profileId === value)?.name ?? null; }, }, { Header: "Missing Subtitles", accessor: "missing_subtitles", selectHide: true, Cell: (row) => { const missing = row.value; return missing.map((v) => ( )); }, }, { accessor: "radarrId", selectHide: true, Cell: ({ row, update }) => { return ( update && update(row, "edit")} > ); }, }, ], [profiles] ); return ( MoviesApi.modify(form)} > ); }; export default MovieView;