Fix Grid & List Layout

This commit is contained in:
headlesdev 2025-05-20 23:36:42 +02:00
parent 88b9a833ff
commit b7876ec995
2 changed files with 4 additions and 2 deletions

View File

@ -1,5 +1,4 @@
import { ChangeEvent } from "react";
import Cookies from "js-cookie";
interface SearchAndLayoutProps {
search: string;

View File

@ -13,7 +13,10 @@ const useSite = () => {
const [siteId, setSiteId] = useState("");
const [loading, setLoading] = useState(false);
const [currentPage, setCurrentPage] = useState(1);
const [itemPerPage, setItemPerPage] = useState(5);
const [itemPerPage, setItemPerPage] = useState(() => {
const savedValue = Cookies.get('sites-itemPerPage');
return savedValue ? parseInt(savedValue, 10) : 5;
});
const [total, setTotal] = useState(0);
const [search, setSearch] = useState("");
const [sites, setSites] = useState([]);