import { useEffect, useRef, useState } from 'react'; import { Send } from 'lucide-react'; import type { DashboardOverview, DashboardRoomActivity } from './api'; import type { Locale, Messages } from './i18n'; import { ParsedBody } from './ParsedBody'; import { buildRoomThreadEntries, isWatcherRoomMessage, type RoomThreadEntry, } from './roomThread'; type InboxItem = DashboardOverview['inbox'][number]; type RoomMessage = DashboardRoomActivity['messages'][number]; type RoomOutput = NonNullable< DashboardRoomActivity['pairedTask'] >['outputs'][number]; type RoomTask = NonNullable; type RoomTurn = NonNullable; export interface RoomEntryWithService { jid: string; name: string; folder: string; agentType: string; status: 'processing' | 'waiting' | 'inactive'; elapsedMs: number | null; pendingMessages: boolean; pendingTasks: number; serviceId: string; } interface RoomCardFormatters { formatDate: (value: string | null | undefined, locale: Locale) => string; formatDuration: (value: number | null, t: Messages) => string; formatLiveElapsed: (value: number, t: Messages) => string; senderRoleClass: (value: string | null | undefined) => string; statusLabel: (status: string, t: Messages) => string; } interface RoomMessageFormProps { busy: boolean; onChange: (value: string) => void; onSubmit: () => void; t: Messages; value: string; } function RoomMessageForm({ busy, onChange, onSubmit, t, value, }: RoomMessageFormProps) { return (
{ event.preventDefault(); onSubmit(); }} >