movie-web/src/components/SearchBar.tsx

29 lines
855 B
TypeScript
Raw Normal View History

2022-02-10 23:45:17 +01:00
import { IconButton } from "./Buttons/IconButton";
import { Icons } from "./Icon";
import {
TextInputControl,
TextInputControlPropsNoLabel,
} from "./TextInputs/TextInputControl";
2022-02-07 23:22:35 +01:00
export interface SearchBarProps extends TextInputControlPropsNoLabel {
buttonText?: string;
onClick?: () => void;
2022-02-10 23:45:17 +01:00
placeholder?: string;
2022-02-07 23:22:35 +01:00
}
export function SearchBarInput(props: SearchBarProps) {
return (
2022-02-10 23:45:17 +01:00
<div className="flex items-center space-x-4 pl-8 pr-2 py-2 bg-dink-500 rounded-full">
<TextInputControl
onChange={props.onChange}
value={props.value}
className="placeholder-dink-150 bg-transparent flex-1 focus:outline-none text-white"
placeholder={props.placeholder}
/>
<IconButton icon={Icons.SEARCH} onClick={props.onClick}>
{props.buttonText || "Search"}
</IconButton>
2022-02-07 23:22:35 +01:00
</div>
2022-02-10 23:45:17 +01:00
);
2022-02-07 23:22:35 +01:00
}