diff --git a/a.sh b/a.sh new file mode 100755 index 0000000..3f3ab8a --- /dev/null +++ b/a.sh @@ -0,0 +1,1131 @@ +#!/bin/bash + +# Create the full directory structure +mkdir -p my-tauri-app/src/chat/{components,lib,providers,styles,types} +mkdir -p my-tauri-app/src/chat/components/{chat,projector,selector,ui} +mkdir -p my-tauri-app/src/styles + +# Create all files with React+HTML equivalents +cat > my-tauri-app/src/chat/components/chat/chat-header.tsx << 'EOL' +import React from 'react'; +import { useChat } from '../../providers/chat-provider'; +import '../../styles/chat.css'; + +export function ChatHeader() { + const { instance } = useChat(); + + return ( +
+
+

+ {instance?.name || 'Chat'} +

+ Online +
+ + +
+ ); +} +EOL + +cat > my-tauri-app/src/chat/components/chat/chat-input.tsx << 'EOL' +import React from 'react'; +import { EmojiPicker } from '../ui/emoji-picker'; +import { useChat } from '../../providers/chat-provider'; +import { useSound } from '../../providers/sound-provider'; +import '../../styles/chat.css'; + +export function ChatInput() { + const [message, setMessage] = React.useState(''); + const [showEmoji, setShowEmoji] = React.useState(false); + const { sendActivity } = useChat(); + const { playSound } = useSound(); + + const handleSend = () => { + if (!message.trim()) return; + playSound('send'); + sendActivity({ + type: 'message', + text: message.trim(), + }); + setMessage(''); + }; + + const handleEmojiSelect = (emoji: string) => { + playSound('click'); + setMessage(prev => prev + emoji); + }; + + return ( + <> +
+ + + + +