// Copyright (c) 2025 Bytedance Ltd. and/or its affiliates // SPDX-License-Identifier: MIT import { AnimatePresence, motion } from "framer-motion"; import { ArrowUp, X } from "lucide-react"; import { useCallback, useRef } from "react"; import { Detective } from "~/components/deer-flow/icons/detective"; import MessageInput, { type MessageInputRef, } from "~/components/deer-flow/message-input"; import { Tooltip } from "~/components/deer-flow/tooltip"; import { Button } from "~/components/ui/button"; import type { Option, Resource } from "~/core/messages"; import { setEnableBackgroundInvestigation, useSettingsStore, } from "~/core/store"; import { cn } from "~/lib/utils"; export function InputBox({ className, responding, feedback, onSend, onCancel, onRemoveFeedback, }: { className?: string; size?: "large" | "normal"; responding?: boolean; feedback?: { option: Option } | null; onSend?: ( message: string, options?: { interruptFeedback?: string; resources?: Array; }, ) => void; onCancel?: () => void; onRemoveFeedback?: () => void; }) { const backgroundInvestigation = useSettingsStore( (state) => state.general.enableBackgroundInvestigation, ); const containerRef = useRef(null); const inputRef = useRef(null); const feedbackRef = useRef(null); const handleSendMessage = useCallback( (message: string, resources: Array) => { console.log(message, resources); if (responding) { onCancel?.(); } else { if (message.trim() === "") { return; } if (onSend) { onSend(message, { interruptFeedback: feedback?.option.value, resources, }); onRemoveFeedback?.(); } } }, [responding, onCancel, onSend, feedback, onRemoveFeedback], ); return (
{feedback && (
{feedback.option.text}
)}

Investigation Mode: {backgroundInvestigation ? "On" : "Off"}

When enabled, DeerFlow will perform a quick search before planning. This is useful for researches related to ongoing events and news.

} >
); }