import { Pagination } from "react-bootstrap";
import React from 'react';
function Paginations(props) {
return (
<>
{(props.endPage > 5) ?
props.handlePage(1)} />
{props.index === 1 ? props.handlePage(props.index)} /> : props.handlePage(props.index - 1)} />}
{props.index === props.endPage - 1 ? props.handlePage(props.index - 3)}>{props.index - 3} : ""}
{props.index === props.endPage ? props.handlePage(props.index - 4)}>{props.index - 4} : ""}
{props.index === props.endPage ? props.handlePage(props.index - 3)}>{props.index - 3} : ""}
{props.index < 3 ? "" : props.handlePage(props.index - 2)}>{props.index - 2}}
{props.index === 1 ? "" : props.handlePage(props.index - 1)}>{props.index - 1}}
{props.index}
{props.index === props.endPage ? "" : props.handlePage(props.index + 1)}>{props.index + 1}}
{props.index > props.endPage - 2 ? "" : props.handlePage(props.index + 2)}>{props.index + 2}}
{props.index === 1 ? props.handlePage(props.index + 3)}>{props.index + 3} : ""}
{props.index === 1 ? props.handlePage(props.index + 4)}>{props.index + 4} : ""}
{props.index === 2 ? props.handlePage(props.index + 3)}>{props.index + 3} : ""}
{props.index === props.endPage ? "" : props.handlePage(props.index + 1)} />}
props.handlePage(props.endPage)} />
:
{props.index === 1 ? "" : props.handlePage(1)} />}
{props.index === 1 ? "" : props.handlePage(props.index - 1)} />}
props.handlePage(1)} active={props.index === 1}>1
{props.endPage > 1 ? props.handlePage(2)} active={props.index === 2}>2 : ""}
{props.endPage > 2 ? props.handlePage(3)} active={props.index === 3}>3 : ""}
{props.endPage > 3 ? props.handlePage(4)} active={props.index === 4}>4 : ""}
{props.endPage > 4 ? props.handlePage(5)} active={props.index === 5}>5 : ""}
{props.index === props.endPage ? "" : props.handlePage(props.index + 1)} />}
{props.index === props.endPage ? "" : props.handlePage(props.endPage)} />}
}
>
)
}
export default Paginations