import { createSignal } from 'solid-js' import { useChatContext } from './chat' import type { JSX } from 'solid-js' export interface ChatInputRenderProps { /** Current input value */ value: string /** Set input value */ onChange: (value: string) => void /** Submit the message */ onSubmit: () => void /** Is the chat currently loading */ isLoading: boolean /** Is input disabled */ disabled: boolean /** Ref callback for the input element */ ref: (el: HTMLInputElement | HTMLTextAreaElement) => void } /** @deprecated Use `createChatUI()` and an application-owned input component. Deprecated in 0.8.0. Removed in 1.0.0. */ export interface ChatInputProps { /** Render prop for full control */ children?: (props: ChatInputRenderProps) => JSX.Element /** CSS class name */ class?: string /** Placeholder text */ placeholder?: string /** Disable input */ disabled?: boolean /** Submit on Enter (Shift+Enter for new line) */ submitOnEnter?: boolean } /** * @deprecated Use `createChatUI()` and an application-owned input component. Deprecated in 0.8.0. Removed in 1.0.0. * * Chat input component - handles message input and submission * * Features: * - Auto-growing textarea * - Submit on Enter (Shift+Enter for new line) * - Loading state management * - Full render prop support for custom UIs * * @example * ```tsx * * ``` * * @example Custom UI with render prop * ```tsx * * {({ value, onChange, onSubmit, isLoading }) => ( *
*