mirror of
https://github.com/stackblitz-labs/bolt.diy
synced 2025-06-26 10:16:01 +00:00
34 lines
809 B
TypeScript
34 lines
809 B
TypeScript
import React from 'react';
|
|
|
|
interface SearchInputProps {
|
|
onSearch: (text: string) => void;
|
|
}
|
|
|
|
export const SearchInput: React.FC<SearchInputProps> = ({ onSearch }) => {
|
|
return (
|
|
<div
|
|
className="placeholder-bolt-elements-textTertiary"
|
|
style={{ display: 'flex', justifyContent: 'center', marginBottom: '1rem' }}
|
|
>
|
|
<input
|
|
type="text"
|
|
placeholder="Search"
|
|
onKeyDown={(event) => {
|
|
if (event.key === 'Enter') {
|
|
onSearch(event.currentTarget.value);
|
|
}
|
|
}}
|
|
style={{
|
|
width: '200px',
|
|
padding: '0.5rem',
|
|
marginTop: '0.5rem',
|
|
border: '1px solid #ccc',
|
|
borderRadius: '4px',
|
|
fontSize: '0.9rem',
|
|
textAlign: 'left',
|
|
}}
|
|
/>
|
|
</div>
|
|
);
|
|
};
|