'use client' import { CornerDownLeft, RefreshCcw, StopCircle } from 'lucide-react' import { useState } from 'react' import Textarea from 'react-textarea-autosize' import { Button } from '@/components/ui/button' import { fontMessage } from '@/lib/fonts' import { useCmdEnterSubmit } from '@/lib/hooks/use-command-enter-submit' import { cn } from '@/lib/utils' export interface PromptProps { onSubmit: (value: string) => void onRefresh?: () => void onAbort?: () => void isLoading: boolean } export function Prompt({ onSubmit, onRefresh, onAbort, isLoading }: PromptProps) { const [input, setInput] = useState('') const { formRef, onKeyDown } = useCmdEnterSubmit() return (
{ e.preventDefault() setInput('') await onSubmit(input) }} ref={formRef} className="stretch flex w-full flex-row gap-3 md:max-w-2xl lg:max-w-xl xl:max-w-3xl mx-auto px-4" >
{onRefresh ? ( ) : null} {/* */}