You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
bazarr/frontend/src/Blacklist/Movies/index.tsx

43 lines
1.3 KiB

import { faTrash } from "@fortawesome/free-solid-svg-icons";
import React, { FunctionComponent } from "react";
import { Container, Row } from "react-bootstrap";
import { Helmet } from "react-helmet";
import { useBlacklistMovies } from "../../@redux/hooks";
import { MoviesApi } from "../../apis";
import { AsyncStateOverlay, ContentHeader } from "../../components";
import { useAutoUpdate } from "../../utilites/hooks";
import Table from "./table";
interface Props {}
const BlacklistMoviesView: FunctionComponent<Props> = () => {
const [blacklist, update] = useBlacklistMovies();
useAutoUpdate(update);
return (
<AsyncStateOverlay state={blacklist}>
{(data) => (
<Container fluid>
<Helmet>
<title>Movies Blacklist - Bazarr</title>
</Helmet>
<ContentHeader>
<ContentHeader.AsyncButton
icon={faTrash}
disabled={data.length === 0}
promise={() => MoviesApi.deleteBlacklist(true)}
onSuccess={update}
>
Remove All
</ContentHeader.AsyncButton>
</ContentHeader>
<Row>
<Table blacklist={data} update={update}></Table>
</Row>
</Container>
)}
</AsyncStateOverlay>
);
};
export default BlacklistMoviesView;