Rebuild the site on the stack the other converted sites share: Vite 8, React 19, TypeScript 7, react-router 8, Biome and sanitize.css, with the site data moved out of the bundle into static-contents/. - base the database code on cerebellum.neuroinf.jp and keep the pupil platform's table layout, about page and menu - load the Flickr badge feed as JSONP without extra libraries - serve the XooNIps data from modules/xoonips/, redirecting the old download and /database/file URLs - restate the column widths as border-box totals and keep form controls on white - track page views with GA4
32 lines
1.0 KiB
TypeScript
32 lines
1.0 KiB
TypeScript
import { useCallback, useMemo } from 'react';
|
|
import { useLocation } from 'react-router';
|
|
import type { MultiLang } from '../config';
|
|
import DatabaseListItem from './lib/DatabaseListItem';
|
|
import ItemUtil, { type SearchCallbackFunc, type SortCondition } from './lib/ItemUtil';
|
|
|
|
interface Props {
|
|
lang: MultiLang;
|
|
}
|
|
|
|
const DatabaseSearchByAdvancedKeyword = (props: Props) => {
|
|
const { lang } = props;
|
|
const location = useLocation();
|
|
const query = useMemo(() => ItemUtil.getAdvancedSearchQueryByQuery(location.search), [location.search]);
|
|
|
|
const searchFunc = useCallback(
|
|
(condition: SortCondition, func: SearchCallbackFunc) => {
|
|
ItemUtil.getListByAdvancedSearchQuery(query, condition, func);
|
|
},
|
|
[query]
|
|
);
|
|
|
|
return (
|
|
<div className="list">
|
|
<h3>Listing item</h3>
|
|
<DatabaseListItem lang={lang} url={ItemUtil.getSearchByAdvancedKeywordsUrl(query)} search={searchFunc} />
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default DatabaseSearchByAdvancedKeyword;
|