import classNames from "classnames"; import { useRef } from "react"; import { HiLightBulb, HiSearch } from "react-icons/hi"; interface Props { prompt: string; loading: boolean; onChange: (value: string) => void; onSubmit: () => void; } export const InputGeneration: React.FC = ({ prompt, loading, onChange, onSubmit, }) => { const input = useRef(null); return (
input.current?.focus()} >
onChange(e.target.value)} onKeyDown={(e) => { if (e.key === "Enter" && prompt && !loading) { onSubmit(); } }} />
); };