1 import { Component, linkEvent } from "inferno";
2 import { i18n } from "../../i18next";
4 interface PaginatorProps {
6 onChange(val: number): any;
9 export class Paginator extends Component<PaginatorProps, any> {
10 constructor(props: any, context: any) {
11 super(props, context);
15 <div className="my-2">
17 className="btn btn-secondary me-2"
18 disabled={this.props.page == 1}
19 onClick={linkEvent(this, this.handlePrev)}
24 className="btn btn-secondary"
25 onClick={linkEvent(this, this.handleNext)}
33 handlePrev(i: Paginator) {
34 i.props.onChange(i.props.page - 1);
37 handleNext(i: Paginator) {
38 i.props.onChange(i.props.page + 1);