nonebot2/website/src/components/Driver.tsx

24 lines
483 B
TypeScript
Raw Normal View History

2021-12-29 13:33:36 +08:00
import React from "react";
2021-12-29 21:09:31 +08:00
import drivers from "../../static/drivers.json";
import { useFilteredObjs } from "../libs/store";
2021-12-29 13:33:36 +08:00
export default function Driver() {
2021-12-29 21:09:31 +08:00
const {
filter,
setFilter,
filteredObjs: filteredDrivers,
} = useFilteredObjs(drivers);
return (
<>
<div>
<input
value={filter}
onChange={(event) => setFilter(event.target.value)}
/>
</div>
<div>{filteredDrivers.toString()}</div>
</>
);
2021-12-29 13:33:36 +08:00
}