"use client"; import { useState } from "react"; import { Button } from "@/components/ui/button"; import { Textarea } from "@/components/ui/textarea"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "@/components/ui/select"; import { Send } from "lucide-react"; interface MessageComposerProps { channelId: string; onSend: (message: { content: string; type: string }) => void; isSending?: boolean; disabled?: boolean; } const MESSAGE_TYPES = [ { value: "dialogue", label: "Dialogue" }, { value: "reasoning", label: "Reasoning" }, { value: "decision", label: "Decision" }, { value: "action", label: "Action" }, { value: "blocker", label: "Blocker" }, { value: "technical", label: "Technical" }, ]; export function MessageComposer({ onSend, isSending, disabled, }: MessageComposerProps) { const [content, setContent] = useState(""); const [type, setType] = useState("dialogue"); const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); if (!content.trim()) return; onSend({ content: content.trim(), type }); setContent(""); }; const handleKeyDown = (e: React.KeyboardEvent) => { if (e.key === "Enter" && !e.shiftKey) { e.preventDefault(); handleSubmit(e); } }; return ( // paddingBottom includes the safe-area inset so the composer clears the // home indicator on notched phones instead of sitting flush under it.