import { h } from "preact";

import { Link } from "preact-router";


const Pageselector = (props) => {
    var items = [];
    if(!isNaN(props.start)&&!isNaN(props.end)&&!isNaN(props.current))
    for(var i=props.start; i<=props.end; i++){
        items.push(<li><Link {...(i==props.current?{className:'active'}:{})}   href={`/users/${i}`} value={i} >{i}</Link></li>);
    }
    //items.push(<li><a href="" >&gt;</a></li>);
    return (
        <div class="page-nav-bar">
            <ul>
                {items}
            </ul>
        </div>);
}

export default Pageselector;