'use client' import { useEffect, useState } from 'react' import { useParams } from 'next/navigation' import Link from 'next/link' import Image from 'next/image' import { Header } from '@/components/Header' import { Footer } from '@/components/Footer' import { api } from '@/lib/api' import { Calendar, Clock, Eye, ArrowLeft, Tag, Loader2, User, BookOpen, Twitter, Linkedin, Copy, Check, } from 'lucide-react' interface BlogPost { id: number title: string slug: string excerpt: string | null content: string cover_image: string | null category: string | null tags: string[] meta_title: string | null meta_description: string | null is_published: boolean published_at: string | null created_at: string updated_at: string view_count: number author: { id: number name: string | null } } export default function BlogPostPage() { const params = useParams() const slug = params.slug as string const [post, setPost] = useState(null) const [loading, setLoading] = useState(true) const [error, setError] = useState(null) const [copied, setCopied] = useState(false) useEffect(() => { if (slug) { loadPost() } }, [slug]) const loadPost = async () => { setLoading(true) setError(null) try { const data = await api.getBlogPost(slug) setPost(data) } catch (err) { setError('Blog post not found') } finally { setLoading(false) } } const formatDate = (dateString: string) => { return new Date(dateString).toLocaleDateString('en-US', { year: 'numeric', month: 'long', day: 'numeric', }) } const estimateReadTime = (content: string) => { const words = content.split(/\s+/).length const minutes = Math.ceil(words / 200) return `${minutes} min read` } const handleCopyLink = async () => { await navigator.clipboard.writeText(window.location.href) setCopied(true) setTimeout(() => setCopied(false), 2000) } const shareOnTwitter = () => { const url = encodeURIComponent(window.location.href) const text = encodeURIComponent(post?.title || '') window.open(`https://twitter.com/intent/tweet?url=${url}&text=${text}`, '_blank') } const shareOnLinkedIn = () => { const url = encodeURIComponent(window.location.href) window.open(`https://www.linkedin.com/sharing/share-offsite/?url=${url}`, '_blank') } if (loading) { return (

Loading article...

) } if (error || !post) { return (
{/* Background */}

Article Not Found

The article you're looking for doesn't exist or has been removed from our collection.

Back to Briefings
) } return (
{/* Background Effects */}
{/* Back Link */} Back to Briefings {/* Hero Header */}
{post.category && ( {post.category} )} {estimateReadTime(post.content)}

{post.title}

{post.excerpt && (

{post.excerpt}

)} {/* Meta Row */}
{post.author.name && (

{post.author.name}

Author

)}
{post.published_at ? formatDate(post.published_at) : formatDate(post.created_at)} {post.view_count} views
{/* Share */}
{/* Cover Image */} {post.cover_image && (
{post.title}
)} {/* Content */}
{/* Tags */} {post.tags.length > 0 && (
{post.tags.map((tag) => ( {tag} ))}
)} {/* Author Box */} {post.author.name && (

Written by

{post.author.name}

Expert domain hunter sharing insights and strategies to help you find premium domains.

)} {/* CTA */}
Ready to Hunt?

Start finding premium domains today

Join thousands of domain hunters using pounce to discover, monitor, and secure valuable domains.

Join the Hunt More Articles
) }