snowballtools-base/packages/frontend/src/components/SearchBar.tsx
2024-02-26 22:24:15 -05:00

26 lines
670 B
TypeScript

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