export const Pagination = (props)=>{
let [arrPage,arrnextPages] = useState([1,2,3,4,5,6,7,8,9,10]);
let [prevPage,nextPages] = useState(1);
const pageOnClick=(e=>{
nextPages(parseInt(e.target.value));
let stateUp = (page)=>{
let pageNum = page + 10;
if((page%10)!==0){
props.getUsers(page);
}
if((page%10)===0&&prevPage>=page){
arrnextPages([]);
for (let i = 1; i<= page; i++){
arrPage.push(i)
};
arrPage.splice(-10);
props.getUsers(page)
}
if((page%10)===0&&prevPage<page){
for (var i = pageNum; i<= props.page; i--){
arrPage.push(i)
};
arrPage.splice(10);
props.getUsers(page)
}
};
stateUp(parseInt(e.target.value));
});
return (
blabla
)
};
export const Pagination = (props)=>{
let [arrPage,arrnextPages] = useState([1,2,3,4,5,6,7,8,9,10]);
let [prevPage,nextPages] = useState(1);
const pageOnClick=(e=>{
nextPages(parseInt(e.target.value));
let stateUp = (page)=>{
let pageNum = page + 10;
if((page%10)!==0){
props.getUsers(page);
}
if((page%10)===0&&prevPage>=page){
arrnextPages([]);
for (let i = 1; i<= page; i++){
arrPage.push(i)
};
arrPage.splice(-10);
props.getUsers(page)
}
if((page%10)===0&&prevPage<page){
for (var i = pageNum; i<= props.page; i--){
arrPage.push(i)
};
arrPage.splice(10);
props.getUsers(page)
}
};
stateUp(parseInt(e.target.value));
});
return (
blabla
)
};
export const Pagination = (props)=>{
let [arrPage,arrnextPages] = useState([1,2,3,4,5,6,7,8,9,10]);
let [prevPage,nextPages] = useState(1);
const pageOnClick=(e=>{
nextPages(parseInt(e.target.value));
let stateUp = (page)=>{
let pageNum = page + 10;
if((page%10)!==0){
props.getUsers(page);
}
if((page%10)===0&&prevPage>=page){
arrnextPages([]);
for (let i = 1; i<= page; i++){
arrPage.push(i)
};
arrPage.splice(-10);
props.getUsers(page)
}
if((page%10)===0&&prevPage<page){
for (var i = pageNum; i<= props.page; i--){
arrPage.push(i)
};
arrPage.splice(10);
props.getUsers(page)
}
};
stateUp(parseInt(e.target.value));
});
return (
blabla
)
};