import { Component, linkEvent } from 'inferno'; import { SortType } from '../interfaces'; import { i18n } from '../i18next'; interface SortSelectProps { sort: SortType; onChange?(val: SortType): any; hideHot?: boolean; } interface SortSelectState { sort: SortType; } export class SortSelect extends Component { private emptyState: SortSelectState = { sort: this.props.sort, }; constructor(props: any, context: any) { super(props, context); this.state = this.emptyState; } render() { return ( ); } handleSortChange(i: SortSelect, event: any) { i.state.sort = Number(event.target.value); i.setState(i.state); i.props.onChange(i.state.sort); } }