UNPKG

treesap

Version:
11 lines 1.89 kB
import { jsx as _jsx, jsxs as _jsxs } from "hono/jsx/jsx-runtime"; export function ChatInput({ id = "chat-input", terminalId = "terminal-1" }) { return (_jsxs("sapling-island", { loading: "visible", children: [_jsx("template", { children: _jsx("script", { type: "module", src: "/components/ChatInput.js" }) }), _jsx("div", { id: id, class: "border-t border-[#3c3c3c] bg-[#2d2d30] p-3", children: _jsxs("div", { class: "flex items-end gap-2", children: [_jsx("div", { class: "flex-1 relative", children: _jsx("textarea", { id: `${id}-textarea`, placeholder: "Type your command or message...", class: "w-full min-h-[40px] max-h-[120px] px-3 py-2 bg-[#1e1e1e] border border-[#3c3c3c] rounded-lg text-[#cccccc] placeholder-[#888] resize-none focus:outline-none focus:border-[#0e639c] transition-colors text-sm font-mono", rows: 1 }) }), _jsx("button", { type: "button", id: `${id}-send-btn`, class: "px-3 py-2 bg-[#0e639c] hover:bg-[#1177bb] disabled:bg-[#3c3c3c] disabled:text-[#888] text-white rounded-lg transition-colors flex-shrink-0 flex items-center justify-center min-h-[40px]", title: "Send to Input Field", children: _jsx("iconify-icon", { icon: "tabler:arrow-up", width: "16", height: "16" }) }), _jsx("button", { type: "button", id: `${id}-execute-btn`, class: "px-3 py-2 bg-[#28a745] hover:bg-[#218838] disabled:bg-[#3c3c3c] disabled:text-[#888] text-white rounded-lg transition-colors flex-shrink-0 flex items-center justify-center min-h-[40px]", title: "Execute Command", children: _jsx("iconify-icon", { icon: "tabler:player-play", width: "16", height: "16" }) })] }) }), _jsx("script", { dangerouslySetInnerHTML: { __html: ` // Pass chat input data to JavaScript window.chatInputData_${id.replace(/-/g, '_')} = { chatInputId: '${id}', terminalId: '${terminalId}' }; ` } })] })); } //# sourceMappingURL=ChatInput.js.map