import React from "react"; import { BrainAtlasType, MultiLang } from "../config"; import Functions from "../functions"; import DatabaseListItem from "./lib/DatabaseListItem"; import ItemUtil, { SearchCallbackFunc, SortCondition } from "./lib/ItemUtil"; interface Props { lang: MultiLang; itemType: string; subItemType: string; type: BrainAtlasType; } class DatabaseSearchByItemType extends React.Component { constructor(props: Props) { super(props); this.searchFunc = this.searchFunc.bind(this); } searchFunc(condition: SortCondition, func: SearchCallbackFunc) { const { itemType, subItemType, type } = this.props; if (itemType === "") { const res = { total: 0, data: [] }; func(res); } else { ItemUtil.getListByItemType(type, itemType, subItemType, condition, func); } } getUrl() { const { itemType, subItemType, type } = this.props; let url = ItemUtil.getItemTypeSearchUrl(type, itemType, subItemType); return url; } render() { const { lang, type } = this.props; const baseUrl = this.getUrl(); return (

{Functions.mlang("[en]Listing item[/en][ja]アイテム一覧[/ja]", lang)}

); } } export default DatabaseSearchByItemType;