2023-12-07 16:33:37 +00:00
|
|
|
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);
|
2023-12-07 16:33:37 +00:00
|
|
|
|
|
|
|
|
return (
|
2023-12-14 10:37:29 +00:00
|
|
|
<div className="container mx-auto">
|
2023-12-07 16:33:37 +00:00
|
|
|
<ErrorComponent
|
2023-12-17 19:27:22 +00:00
|
|
|
error={closeableError}
|
|
|
|
|
remove={() => setCloseableError(null)}
|
2023-12-07 16:33:37 +00:00
|
|
|
/>
|
2023-12-17 19:27:22 +00:00
|
|
|
<ErrorComponent error={otherError} />
|
|
|
|
|
<TorrentsList torrents={torrents} loading={torrentsLoading} />
|
2023-12-14 10:37:29 +00:00
|
|
|
</div>
|
2023-12-07 16:33:37 +00:00
|
|
|
);
|
|
|
|
|
};
|