'use client'; import { useEffect, useState } from 'react'; import { useParams } from 'next/navigation'; import axios from 'axios'; import ReactMarkdown from 'react-markdown'; import remarkGfm from 'remark-gfm'; import Link from 'next/link'; const BlogPost = () => { const params = useParams(); const [blog, setBlog] = useState(null); const [loading, setLoading] = useState(true); useEffect(() => { const fetchBlog = async () => { try { const response = await axios.get(`http://localhost:3020/api/blog/${params.id}`); if (response.data.ok) { setBlog(response.data.data); } } catch (error) { console.error("Fetch error:", error); } finally { setLoading(false); } }; if (params.id) fetchBlog(); }, [params.id]); if (loading) return (
); if (!blog) return
Blog not found
; return (
← Back to Generator
{/* Header Section */}
{blog.title}
Industry Insight AI Generated

{blog.title}

{new Date(blog.createdAt).toLocaleDateString()} {blog.wordCount || 1800}+ Words SEO Score: {blog.seoScore}%
{/* Performance Metrics Bar */}

SEO Score

{blog.seoScore}%

Human Score

{blog.aiDetectionScore || 92}%

Readability

{blog.readabilityScore || 85}%

Focus Keyword

{blog.focusKeyword || 'Optimized'}

{/* Content Section */}
{blog.content}
{/* SEO Analysis Detail */} {blog.seoDetails && blog.seoDetails.length > 0 && (

SEO Quality Checklist

{blog.seoDetails.map((detail: string, i: number) => (
{detail.toLowerCase().includes('missing') ? ( ) : ( )}
{detail}
))}
)} {/* FAQ Section */} {blog.faqs && blog.faqs.length > 0 && (

Frequently Asked Questions

{blog.faqs.map((faq: any, i: number) => (

{faq.question}

{faq.answer}

))}
)}
{/* Float CTA */}

Want content like this for your site?

Our AI-powered engine analyzes your target niche and builds expert topical authority in seconds.

Upgrade to Pro Plan
); }; export default BlogPost;