From e651becdbe8e7472313a8d6a480406ff74720f40 Mon Sep 17 00:00:00 2001 From: Josh Knapp Date: Sat, 23 May 2026 14:25:28 -0700 Subject: [PATCH] sitesmith: chat modal (messages, input, banner, scope confirm) --- craft/src/panels/sitesmith/ChatInput.tsx | 25 +++++ craft/src/panels/sitesmith/MessageList.tsx | 32 +++++++ craft/src/panels/sitesmith/SitesmithModal.tsx | 94 +++++++++++++++++++ craft/src/panels/topbar/TopBar.tsx | 10 +- 4 files changed, 153 insertions(+), 8 deletions(-) create mode 100644 craft/src/panels/sitesmith/ChatInput.tsx create mode 100644 craft/src/panels/sitesmith/MessageList.tsx create mode 100644 craft/src/panels/sitesmith/SitesmithModal.tsx diff --git a/craft/src/panels/sitesmith/ChatInput.tsx b/craft/src/panels/sitesmith/ChatInput.tsx new file mode 100644 index 0000000..36d6dde --- /dev/null +++ b/craft/src/panels/sitesmith/ChatInput.tsx @@ -0,0 +1,25 @@ +import React, { useState, KeyboardEvent } from 'react'; + +interface Props { disabled?: boolean; placeholder?: string; onSend: (text: string) => void; } + +export const ChatInput: React.FC = ({ disabled, placeholder, onSend }) => { + const [v, setV] = useState(''); + const fire = () => { const t = v.trim(); if (!t || disabled) return; onSend(t); setV(''); }; + const onKey = (e: KeyboardEvent) => { if (e.key === 'Enter' && !e.shiftKey) { e.preventDefault(); fire(); } }; + return ( +
+