add loading animation to resource page

This commit is contained in:
Brandon Egger
2023-08-24 09:52:38 -05:00
parent 4c49950122
commit b839278366
3 changed files with 28 additions and 2 deletions

View File

@ -7,6 +7,7 @@ import { api } from "~/utils/api";
import { parseQueryData } from "~/utils/parseSearchForm";
import Footer from "~/components/Footer";
import Header from "~/components/Header";
import { LoadingBarChart } from "~/components/LoadingBarChart";
const Resources = () => {
const router = useRouter();
@ -31,7 +32,7 @@ const Resources = () => {
const ConditionalTable = () => {
if (!resourceQuery.data) {
return <></>;
return <LoadingBarChart width={200} height={200} />;
}
const totalPages = Math.ceil(resourceQuery.data.count / queryData.perPage);