import { Component, linkEvent } from "inferno"; import { SortType } from "lemmy-js-client"; import { i18n } from "../../i18next"; import { randomStr, sortingHelpUrl } from "../../utils"; import { Icon } from "./icon"; interface SortSelectProps { sort: SortType; onChange?(val: SortType): any; hideHot?: boolean; hideMostComments?: 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); } }