1 import { Component, linkEvent } from "inferno";
2 import { I18NextService } from "../../services";
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="paginator my-2">
17 className="btn btn-secondary me-2"
18 disabled={this.props.page === 1}
19 onClick={linkEvent(this, this.handlePrev)}
21 {I18NextService.i18n.t("prev")}
24 className="btn btn-secondary"
25 onClick={linkEvent(this, this.handleNext)}
27 {I18NextService.i18n.t("next")}
33 handlePrev(i: Paginator) {
34 i.props.onChange(i.props.page - 1);
37 handleNext(i: Paginator) {
38 i.props.onChange(i.props.page + 1);