'use client'; import type { ChatStatus } from 'ai'; import { ChatInput, type PromptInputMessage } from './ChatInput'; import { Suggestion } from '@/components/ai-elements/suggestion'; import { RiOpenaiLine } from '@remixicon/react'; import { Shimmer } from '@/components/ai-elements/shimmer'; import type { OpenRouterModelId } from '@/lib/openrouter'; import { offlineSuggestions, webSearchSuggestions, type PromptSuggestion, } from '@/config/suggestions'; export type { PromptSuggestion } from '@/config/suggestions'; interface ChatPromptProps { value: string; onChange: (value: string) => void; onSubmit: (message: PromptInputMessage) => void; modelId: OpenRouterModelId; onModelChange: (modelId: OpenRouterModelId) => void; onStop?: () => void; status?: ChatStatus; suggestions?: PromptSuggestion[]; webSearchEnabled?: boolean; } export function ChatPrompt({ value, onChange, onSubmit, modelId, onModelChange, onStop, status = 'ready', suggestions, webSearchEnabled = false, }: ChatPromptProps) { const displayedSuggestions = suggestions ?? (webSearchEnabled ? webSearchSuggestions : offlineSuggestions); const handleSuggestionClick = (suggestion: string) => { onChange(suggestion); }; return (
ChatGPT Agent

{webSearchEnabled ? "Ask anything — I'll search the web in real time to find accurate, up-to-date answers with sources." : 'Ask anything — I can help research, explain, compare, and summarize.'}

{displayedSuggestions.map((suggestion) => ( handleSuggestionClick(suggestion.value)} /> ))}
); }