import React from 'react';
import { InputText } from 'primereact/inputtext';
import { Button } from 'primereact/button';

interface PromptInputProps {
    value: string;
    onChange: (value: string) => void;
    onSubmit: () => void;
    placeholder?: string;
}

const PromptInput: React.FC<PromptInputProps> = ({
    value,
    onChange,
    onSubmit,
    placeholder = "Type your prompt here"
}) => {
    return (
        <div className="flex items-center gap-2 p-4 border-t">
            <InputText
                value={value}
                onChange={(e) => onChange(e.target.value)}
                placeholder={placeholder}
                className="flex-grow"
                onKeyPress={(e) => e.key === 'Enter' && onSubmit()}
            />
            <Button
                label="Send"
                icon="pi pi-send"
                onClick={onSubmit}
                disabled={!value.trim()}
            />
        </div>
    );
};

export default PromptInput; 