"use client"; import { motion, AnimatePresence } from "framer-motion"; import { Check, X, FileText, Globe, Code, Sparkles, AlertCircle } from "lucide-react"; // import { Zap, Shield } from "lucide-react"; // Reserved for future features import { useEffect, useState } from "react"; interface InlineResultsProps { isAnalyzing: boolean; showResults: boolean; analysisStep: number; url: string; onReset: () => void; } const analysisSteps = [ "Fetching website content...", "Checking for LLMs.txt...", "Analyzing HTML structure...", "Calculating AI readiness...", ]; // Placeholder data for the results const mockResults = { score: 78, grade: "B+", llmsTxt: true, robotsTxt: true, structuredData: true, semanticHTML: false, metaTags: true, accessibility: true, }; export default function InlineResults({ isAnalyzing, showResults, analysisStep, url: _url, // URL prop available but not used in current implementation onReset, }: InlineResultsProps) { const [displayScore, setDisplayScore] = useState(0); useEffect(() => { if (showResults) { // Animate score counting up const target = mockResults.score; const duration = 1500; const increment = target / (duration / 16); let current = 0; const timer = setInterval(() => { current += increment; if (current >= target) { setDisplayScore(target); clearInterval(timer); } else { setDisplayScore(Math.floor(current)); } }, 16); return () => clearInterval(timer); } }, [showResults]); const getScoreColor = (score: number) => { if (score >= 80) return "#22c55e"; if (score >= 60) return "#eab308"; return "#ef4444"; }; return ( {/* Analyzing State */} {isAnalyzing && ( {/* Progress Bar */}
{/* Glowing dot at the end of progress */}
{/* Status Text */} {analysisSteps[analysisStep]} {/* ASCII Animation */} {'< analyzing />'}
)} {/* Results State */} {showResults && ( {/* Score Display */}
{/* Background glow */} {/* Score circle */}
{displayScore} AI Ready
{/* Quick Checks Grid */} {[ { label: "LLMs.txt", value: mockResults.llmsTxt, icon: FileText, description: "AI instructions", detail: mockResults.llmsTxt ? "Found" : "Missing" }, { label: "Structured Data", value: mockResults.structuredData, icon: Code, description: "Schema markup", detail: mockResults.structuredData ? "Detected" : "Not found" }, { label: "Semantic HTML", value: mockResults.semanticHTML, icon: Globe, description: "HTML5 tags", detail: mockResults.semanticHTML ? "Good" : "Needs work" }, ].map((item, index) => ( {/* Status indicator */}
{item.value ? ( ) : ( )}
{/* Icon */}
{/* Content */}
{item.label}
{item.description}
{item.detail}
))}
{/* Quick Tip */}
Quick Tip
{mockResults.semanticHTML ? "Your site has good semantic HTML structure for AI understanding." : "Add semantic HTML5 elements to improve AI comprehension of your content."}
{/* Action Buttons */}
)}
); }