"use client"; import type React from "react"; import { useState, useRef } from "react"; import { Search, Mic, ArrowUp, Plus, FileText, Code, BookOpen, PenTool, BrainCircuit, Sparkles, } from "lucide-react"; import { motion, AnimatePresence } from "framer-motion"; export function AIAssistantInterface() { const [inputValue, setInputValue] = useState(""); const [searchEnabled, setSearchEnabled] = useState(false); const [deepResearchEnabled, setDeepResearchEnabled] = useState(false); const [reasonEnabled, setReasonEnabled] = useState(false); const [uploadedFiles, setUploadedFiles] = useState([]); const [showUploadAnimation, setShowUploadAnimation] = useState(false); const [activeCommandCategory, setActiveCommandCategory] = useState< string | null >(null); const inputRef = useRef(null); const commandSuggestions = { learn: [ "Explain the Big Bang theory", "How does photosynthesis work?", "What are black holes?", "Explain quantum computing", "How does the human brain work?", ], code: [ "Create a React component for a todo list", "Write a Python function to sort a list", "How to implement authentication in Next.js", "Explain async/await in JavaScript", "Create a CSS animation for a button", ], write: [ "Write a professional email to a client", "Create a product description for a smartphone", "Draft a blog post about AI", "Write a creative story about space exploration", "Create a social media post about sustainability", ], }; const handleUploadFile = () => { setShowUploadAnimation(true); // Simulate file upload with timeout setTimeout(() => { const newFile = `Document.pdf`; setUploadedFiles((prev) => [...prev, newFile]); setShowUploadAnimation(false); }, 1500); }; const handleCommandSelect = (command: string) => { setInputValue(command); setActiveCommandCategory(null); if (inputRef.current) { inputRef.current.focus(); } }; const handleSendMessage = () => { if (inputValue.trim()) { console.log("Sending message:", inputValue); setInputValue(""); } }; return (
{/* Logo with animated gradient */}
{/* Welcome message */}

Ready to assist you

Ask me anything or try one of the suggestions below

{/* Input area with integrated functions and file upload */}
setInputValue(e.target.value)} className="w-full text-gray-700 text-base outline-none placeholder:text-gray-400" />
{/* Uploaded files */} {uploadedFiles.length > 0 && (
{uploadedFiles.map((file, index) => (
{file}
))}
)} {/* Search, Deep Research, Reason functions and actions */}
{/* Upload files */}
{/* Command categories */}
} label="Learn" isActive={activeCommandCategory === "learn"} onClick={() => setActiveCommandCategory( activeCommandCategory === "learn" ? null : "learn" ) } /> } label="Code" isActive={activeCommandCategory === "code"} onClick={() => setActiveCommandCategory( activeCommandCategory === "code" ? null : "code" ) } /> } label="Write" isActive={activeCommandCategory === "write"} onClick={() => setActiveCommandCategory( activeCommandCategory === "write" ? null : "write" ) } />
{/* Command suggestions */} {activeCommandCategory && (

{activeCommandCategory === "learn" ? "Learning suggestions" : activeCommandCategory === "code" ? "Coding suggestions" : "Writing suggestions"}

    {commandSuggestions[ activeCommandCategory as keyof typeof commandSuggestions ].map((suggestion, index) => ( handleCommandSelect(suggestion)} className="p-3 hover:bg-gray-50 cursor-pointer transition-colors duration-75" >
    {activeCommandCategory === "learn" ? ( ) : activeCommandCategory === "code" ? ( ) : ( )} {suggestion}
    ))}
)}
); } interface CommandButtonProps { icon: React.ReactNode; label: string; isActive: boolean; onClick: () => void; } function CommandButton({ icon, label, isActive, onClick }: CommandButtonProps) { return (
{icon}
{label}
); }