import { faTrash } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import React, { FunctionComponent, useMemo } from "react"; import { Link } from "react-router-dom"; import { Column } from "react-table"; import { MoviesApi } from "../../apis"; import { AsyncButton, LanguageText, PageTable, TextPopover, } from "../../components"; interface Props { blacklist: readonly Blacklist.Movie[]; } const Table: FunctionComponent = ({ blacklist }) => { const columns = useMemo[]>( () => [ { Header: "Name", accessor: "title", className: "text-nowrap", Cell: (row) => { const target = `/movies/${row.row.original.radarrId}`; return ( {row.value} ); }, }, { Header: "Language", accessor: "language", Cell: ({ value }) => { if (value) { return ; } else { return null; } }, }, { Header: "Provider", accessor: "provider", }, { Header: "Date", accessor: "timestamp", Cell: (row) => { if (row.value) { return ( {row.value} ); } else { return null; } }, }, { accessor: "subs_id", Cell: (row) => { const subs_id = row.value; return ( MoviesApi.deleteBlacklist(false, { provider: row.row.original.provider, subs_id, }) } > ); }, }, ], [] ); return ( ); }; export default Table;