Adds the WaitingForUserInput state (#3620)
This commit is contained in:
@@ -5,6 +5,7 @@ import { Button } from './ui/button';
|
||||
import type { View } from '../App';
|
||||
import Stop from './ui/Stop';
|
||||
import { Attach, Send, Close, Microphone } from './icons';
|
||||
import { ChatState } from '../types/chatState';
|
||||
import { debounce } from 'lodash';
|
||||
import { LocalMessageStorage } from '../utils/localMessageStorage';
|
||||
import { Message } from '../types/message';
|
||||
@@ -52,7 +53,7 @@ interface ModelLimit {
|
||||
|
||||
interface ChatInputProps {
|
||||
handleSubmit: (e: React.FormEvent) => void;
|
||||
isLoading?: boolean;
|
||||
chatState: ChatState;
|
||||
onStop?: () => void;
|
||||
commandHistory?: string[]; // Current chat's message history
|
||||
initialValue?: string;
|
||||
@@ -78,7 +79,7 @@ interface ChatInputProps {
|
||||
|
||||
export default function ChatInput({
|
||||
handleSubmit,
|
||||
isLoading = false,
|
||||
chatState = ChatState.Idle,
|
||||
onStop,
|
||||
commandHistory = [],
|
||||
initialValue = '',
|
||||
@@ -99,6 +100,9 @@ export default function ChatInput({
|
||||
const [displayValue, setDisplayValue] = useState(initialValue); // For immediate visual feedback
|
||||
const [isFocused, setIsFocused] = useState(false);
|
||||
const [pastedImages, setPastedImages] = useState<PastedImage[]>([]);
|
||||
|
||||
// Derived state - chatState != Idle means we're in some form of loading state
|
||||
const isLoading = chatState !== ChatState.Idle;
|
||||
const { alerts, addAlert, clearAlerts } = useAlerts();
|
||||
const dropdownRef = useRef<HTMLDivElement>(null);
|
||||
const toolCount = useToolCount();
|
||||
|
||||
Reference in New Issue
Block a user