import type { Message } from 'ai'; import type { LegacyRef } from 'react'; import React from 'react'; import { ClientOnly } from 'remix-utils/client-only'; import { IconButton } from '~/components/ui/IconButton'; import { Workspace } from '~/components/workspace/Workspace.client'; import { classNames } from '~/utils/classNames'; import { Messages } from './Messages.client'; import { SendButton } from './SendButton.client'; interface BaseChatProps { textareaRef?: LegacyRef | undefined; messagesSlot?: React.ReactNode; workspaceSlot?: React.ReactNode; chatStarted?: boolean; isStreaming?: boolean; messages?: Message[]; enhancingPrompt?: boolean; promptEnhanced?: boolean; input?: string; sendMessage?: () => void; handleInputChange?: (event: React.ChangeEvent) => void; enhancePrompt?: () => void; } const EXAMPLES = [{ text: 'Example' }, { text: 'Example' }, { text: 'Example' }, { text: 'Example' }]; const TEXTAREA_MIN_HEIGHT = 72; export const BaseChat = React.forwardRef( ( { textareaRef, chatStarted = false, isStreaming = false, enhancingPrompt = false, promptEnhanced = false, messages, input = '', sendMessage, handleInputChange, enhancePrompt, }, ref, ) => { const TEXTAREA_MAX_HEIGHT = chatStarted ? 400 : 200; return (
{!chatStarted && (

Where ideas begin.

Bring ideas to life in seconds or get help on existing projects.

{EXAMPLES.map((suggestion, index) => ( ))}
)}
{() => { return chatStarted ? ( ) : null; }}