blowater/app/UI/filter.tsx
Water Blower 55d6735e7b
use esbuild & JSR (#486)
and remove submodules
2024-07-03 15:46:31 +08:00

35 lines
927 B
TypeScript

/* jsx h */
import { Component, h } from "preact";
import { emitFunc } from "../event-bus.ts";
import { Empty } from "./_helper.ts";
type Props = {
emit: emitFunc<FilterContent>;
};
export class Filter extends Component<Props, Empty> {
render() {
return (
<div class="border flex flex-col items-center">
<div class="flex flex-row border">
<input
placeholder={"search content"}
onInput={(e) => {
this.props.emit({
type: "FilterContent",
content: e.currentTarget.value,
});
}}
>
</input>
</div>
</div>
);
}
}
export type FilterContent = {
type: "FilterContent";
content: string;
};