import { Component, linkEvent } from 'inferno'; import { SortType } from 'lemmy-js-client'; import { sortingHelpUrl, randomStr } from '../utils'; import { i18n } from '../i18next'; interface SortSelectProps { sort: SortType; onChange?(val: SortType): any; hideHot?: boolean; } interface SortSelectState { sort: SortType; } export class SortSelect extends Component { private id = `sort-select-${randomStr()}`; private emptyState: SortSelectState = { sort: this.props.sort, }; constructor(props: any, context: any) { super(props, context); this.state = this.emptyState; } static getDerivedStateFromProps(props: any): SortSelectState { return { sort: props.sort, }; } render() { return ( <> ); } handleSortChange(i: SortSelect, event: any) { i.props.onChange(event.target.value); } }