rqbit/crates/librqbit/webui/src/components/RootContent.tsx

24 lines
895 B
TypeScript
Raw Normal View History

import { TorrentsList } from "./TorrentsList";
import { ErrorComponent } from "./ErrorComponent";
2023-12-17 19:27:22 +00:00
import { useTorrentStore } from "../stores/torrentStore";
import { useErrorStore } from "../stores/errorStore";
export const RootContent = (props: {}) => {
let closeableError = useErrorStore((state) => state.closeableError);
let setCloseableError = useErrorStore((state) => state.setCloseableError);
let otherError = useErrorStore((state) => state.otherError);
let torrents = useTorrentStore((state) => state.torrents);
let torrentsLoading = useTorrentStore((state) => state.torrentsLoading);
return (
<div className="container mx-auto">
<ErrorComponent
2023-12-17 19:27:22 +00:00
error={closeableError}
remove={() => setCloseableError(null)}
/>
2023-12-17 19:27:22 +00:00
<ErrorComponent error={otherError} />
<TorrentsList torrents={torrents} loading={torrentsLoading} />
</div>
);
};