snowballtools-base/packages/frontend/src/components/SearchBar.tsx

26 lines
670 B
TypeScript
Raw Normal View History

import React, { forwardRef, RefAttributes } from 'react';
2024-02-27 03:24:15 +00:00
import { SearchIcon } from './shared/CustomIcon';
import { Input, InputProps } from './shared/Input';
const SearchBar: React.ForwardRefRenderFunction<
HTMLInputElement,
InputProps & RefAttributes<HTMLInputElement>
2024-02-27 03:24:15 +00:00
> = ({ value, onChange, placeholder = 'Search', ...props }) => {
return (
2024-02-27 03:24:15 +00:00
<div className="relative flex w-full">
<Input
2024-02-27 03:24:15 +00:00
leftIcon={<SearchIcon />}
onChange={onChange}
value={value}
type="search"
placeholder={placeholder}
2024-02-27 03:24:15 +00:00
appearance={'borderless'}
{...props}
/>
</div>
);
};
export default forwardRef(SearchBar);