test table
This commit is contained in:
parent
35ed04c2d7
commit
5b9a9932bb
|
@ -22,14 +22,14 @@ function Button({ children, disabled, className, ...props }) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function Table({ items, count, headers, actions, offset, setOffset, pageSize = 10 }) {
|
export default function Table({ items, count, headers, actions, offset, setOffset, pageSize = 10 }) {
|
||||||
useEffect(() => {
|
// useEffect(() => {
|
||||||
if (offset + pageSize > count) setOffset(Math.floor(count / pageSize));
|
// if (offset + pageSize > count) setOffset(Math.floor(count / pageSize));
|
||||||
else if (offset < 0) setOffset(0);
|
// else if (offset < 0) setOffset(0);
|
||||||
else if (offset % pageSize) setOffset(offset - (offset % pageSize));
|
// else if (offset % pageSize) setOffset(offset - (offset % pageSize));
|
||||||
}, [offset, pageSize, setOffset]);
|
// }, [offset, pageSize, setOffset]);
|
||||||
|
|
||||||
if (!items) {
|
if (!items) {
|
||||||
return <>aaaa</>;
|
return <div className="text-center">no entries</div>;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
Reference in New Issue