diff --git a/src/components/ChatInterface.tsx b/src/components/ChatInterface.tsx index 51da597..95c6e98 100644 --- a/src/components/ChatInterface.tsx +++ b/src/components/ChatInterface.tsx @@ -19,7 +19,9 @@ const prompts = [ "Who is this for?", "Show me how I can earn", "Developers", - "Sample MCPs" + "Sample MCPs", + "About Us", + "Our Team" ]; const ChatInterface: React.FC = ({ onPromptSelect, isExpanded }) => { @@ -28,6 +30,8 @@ const ChatInterface: React.FC = ({ onPromptSelect, isExpande const [isThinking, setIsThinking] = useState(false); const [chatKey, setChatKey] = useState(0); const [thinkingStage, setThinkingStage] = useState<"thinking" | "memory" | null>(null); + const [geminiSearchCount, setGeminiSearchCount] = useState(0); + const [showLoginBar, setShowLoginBar] = useState(false); const scrollAnchorRef = useRef(null); const promptPatterns = [ @@ -55,6 +59,14 @@ const ChatInterface: React.FC = ({ onPromptSelect, isExpande pattern: /\b(sample|example|show|some)\b.*\b(mcp|mcp server|mcp servers|mcps)\b|\b(mcp|mcp server|mcp servers|mcps)\b.*\b(sample|example|show|some)\b/i, prompt: "Sample MCPs", }, + { + pattern: /(about|who\s+are\s+you|tell\s+me\s+about.*(company|us|fastcode))/i, + prompt: "About Us", + }, + { + pattern: /(team|who\s+works\s+here|meet\s+the\s+team|who\s+built\s+this)/i, + prompt: "Our Team", + }, ]; @@ -64,11 +76,48 @@ const ChatInterface: React.FC = ({ onPromptSelect, isExpande "Who is this for?": "MCP is for developers, creators, and businesses who want to build, deploy, and monetize AI-powered code packages easily. Here's a detailed view.", "Show me how I can earn": "You can earn by creating MCPs, deploying them, and setting your pricing. Track usage and get paid automatically as others use your MCPs. I have generated a detailed view on the right.", "Developers": "A lot of people have put there thoughts and ideas to bring this amazing idea to life. Here on the right I have displayed all the developers who are behind Fastcode.", - "Sample MCPs": "People all over the world are building MCP servers and earning passively. It's time you start you own as well. Here are some samples for your inspiration." + "Sample MCPs": "People all over the world are building MCP servers and earning passively. It's time you start you own as well. Here are some samples for your inspiration.", + "About Us": "Fastcode is at the forefront of AI innovation, providing cutting-edge solutions for developers and businesses. We're passionate about making AI accessible and monetizable for everyone. Let me show you more about us in the detailed view.", + "Our Team": "Our team is a diverse group of passionate individuals dedicated to building the future of AI development. We've brought together top talent from around the world to create something truly special. Check out the team section for more details!" }; const handlePromptClick = (prompt: string, userInput?: string) => { setMessages(prev => [...prev, { text: userInput || prompt, isUser: true }]); + + // Handle navigation for specific sections + if (prompt === 'About Us') { + const aboutSection = document.getElementById('about'); + if (aboutSection) { + aboutSection.scrollIntoView({ behavior: 'smooth' }); + } + setMessages(prev => [ + ...prev, + { + text: promptResponses[prompt], + isUser: false, + isTyping: false, + }, + ]); + return; + } + + if (prompt === 'Our Team') { + const teamSection = document.getElementById('team'); + if (teamSection) { + teamSection.scrollIntoView({ behavior: 'smooth' }); + } + setMessages(prev => [ + ...prev, + { + text: promptResponses[prompt], + isUser: false, + isTyping: false, + }, + ]); + return; + } + + // Handle other prompts with the original animation flow setThinkingStage("thinking"); setIsThinking(true); @@ -113,8 +162,16 @@ const ChatInterface: React.FC = ({ onPromptSelect, isExpande // 🔁 Fallback to Gemini if no predefined response if (!responseText) { + // Block if limit reached + if (geminiSearchCount >= 5) { + setShowLoginBar(true); + setIsThinking(false); + setThinkingStage(null); + return; + } try { responseText = await generateResponse(promptToUse); + setGeminiSearchCount(count => count + 1); } catch (err) { responseText = "Sorry, something went wrong while generating a response."; console.error(err); @@ -140,7 +197,6 @@ const ChatInterface: React.FC = ({ onPromptSelect, isExpande }; - const handleKeyPress = (e: React.KeyboardEvent) => { if (e.key === 'Enter') handleSendMessage(); }; @@ -250,6 +306,14 @@ const ChatInterface: React.FC = ({ onPromptSelect, isExpande )} + {showLoginBar && ( +
+ You’ve reached the limit of 5 Gemini searches. Please log in to continue. + {/* Add your login button here */} + +
+ )} + {/* Input Area */}
{/* First Line: Text Input */} diff --git a/src/components/Footer.tsx b/src/components/Footer.tsx new file mode 100644 index 0000000..f478060 --- /dev/null +++ b/src/components/Footer.tsx @@ -0,0 +1,166 @@ +import React, { useState } from 'react'; +import { Button } from '@/components/ui/button'; +import { Input } from '@/components/ui/input'; +import { Textarea } from '@/components/ui/textarea'; +import { Mail, Send, Twitter, Github, Linkedin } from 'lucide-react'; + +const Footer = () => { + const [formData, setFormData] = useState({ + name: '', + email: '', + message: '' + }); + const [isSubmitting, setIsSubmitting] = useState(false); + const [isSubmitted, setIsSubmitted] = useState(false); + + const handleChange = (e: React.ChangeEvent) => { + const { name, value } = e.target; + setFormData(prev => ({ + ...prev, + [name]: value + })); + }; + + const handleSubmit = (e: React.FormEvent) => { + e.preventDefault(); + setIsSubmitting(true); + + // Simulate form submission + setTimeout(() => { + console.log('Form submitted:', formData); + setIsSubmitting(false); + setIsSubmitted(true); + setFormData({ name: '', email: '', message: '' }); + + // Reset submission status after 3 seconds + setTimeout(() => setIsSubmitted(false), 3000); + }, 1000); + }; + + return ( +