import { faBookmark as farBookmark } from "@fortawesome/free-regular-svg-icons"; import { faBookmark, faCheck, faExclamationTriangle, 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 { movieUpdateByRange, movieUpdateInfoAll } from "../@redux/actions"; import { useRawMovies } from "../@redux/hooks"; import { useReduxAction } from "../@redux/hooks/base"; import { MoviesApi } from "../apis"; import { ActionBadge } from "../components"; import BaseItemView from "../generic/BaseItemView"; interface Props {} const MovieView: FunctionComponent = () => { const [movies] = useRawMovies(); const load = useReduxAction(movieUpdateByRange); 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: "Exist", accessor: "exist", selectHide: true, Cell: ({ row, value }) => { const exist = value; const { path } = row.original; return ( ); }, }, { Header: "Audio", accessor: "audio_language", Cell: (row) => { return row.value.map((v) => ( {v.name} )); }, }, { Header: "Languages Profile", accessor: "profileId", Cell: ({ value, loose }) => { if (loose) { // Define in generic/BaseItemView/table.tsx const profiles = loose[0] as Profile.Languages[]; return profiles.find((v) => v.profileId === value)?.name ?? null; } else { return null; } }, }, { accessor: "missing_subtitles", selectHide: true, Cell: (row) => { const missing = row.value; return missing.map((v) => ( {v.code2} )); }, }, { accessor: "radarrId", selectHide: true, Cell: ({ row, externalUpdate }) => ( externalUpdate && externalUpdate(row, "edit")} > ), }, ], [] ); return ( []} modify={(form) => MoviesApi.modify(form)} > ); }; export default MovieView;