refactor: centralize global footer and simplify agent screen input handling
```
This commit is contained in:
Mohamed Boudra
2025-10-23 12:35:28 +02:00
parent 027ae59ae7
commit 10189514dd
6 changed files with 43 additions and 43 deletions
@@ -14,7 +14,7 @@ interface AgentInputAreaProps {
export function AgentInputArea({ agentId }: AgentInputAreaProps) {
const { theme } = useUnistyles();
const { agents, ws, sendAgentMessage, setAgentMode } = useSession();
const { startRealtime } = useRealtime();
const { isRealtimeMode, startRealtime } = useRealtime();
const audioRecorder = useAudioRecorder();
const [userInput, setUserInput] = useState("");
@@ -24,6 +24,11 @@ export function AgentInputArea({ agentId }: AgentInputAreaProps) {
const agent = agents.get(agentId);
// Hide when realtime is active - global footer takes over
if (isRealtimeMode) {
return null;
}
async function handleSendMessage() {
if (!userInput.trim() || !ws.isConnected) return;