import React from 'react'; import { Helmet } from 'react-helmet-async'; import TOOL_FAQS from '../data/faqs'; const SEO = ({ title, description, keywords, path = '/', type = 'website', image = 'https://dewe.dev/og-image.png', toolId = null }) => { const siteUrl = 'https://dewe.dev'; const fullUrl = `${siteUrl}${path}`; const fullTitle = title ? `${title} | Developer Tools` : 'Developer Tools - Essential Web Developer Utilities'; const defaultDescription = 'Free online developer tools for JSON, CSV, Base64, URL encoding, code beautification, and more. Privacy-first, no data storage, all processing in your browser.'; const metaDescription = description || defaultDescription; const defaultKeywords = 'developer tools, json editor, csv converter, base64 encoder, url encoder, code beautifier, diff tool, web developer utilities, online tools'; const metaKeywords = keywords || defaultKeywords; // Get FAQ data for this tool const faqs = toolId && TOOL_FAQS[toolId] ? TOOL_FAQS[toolId] : null; // Generate breadcrumb schema const breadcrumbSchema = { "@context": "https://schema.org", "@type": "BreadcrumbList", "itemListElement": [ { "@type": "ListItem", "position": 1, "name": "Home", "item": siteUrl } ] }; // Add current page to breadcrumb if not homepage if (path !== '/') { breadcrumbSchema.itemListElement.push({ "@type": "ListItem", "position": 2, "name": title || "Page", "item": fullUrl }); } // Generate FAQ schema if FAQs exist const faqSchema = faqs ? { "@context": "https://schema.org", "@type": "FAQPage", "mainEntity": faqs.map(faq => ({ "@type": "Question", "name": faq.question, "acceptedAnswer": { "@type": "Answer", "text": faq.answer } })) } : null; return ( {/* Basic Meta Tags */} {fullTitle} {/* Open Graph / Facebook */} {/* Twitter Card */} {/* Additional SEO Tags */} {/* JSON-LD Structured Data - WebApplication */} {/* JSON-LD Structured Data - Breadcrumb */} {/* JSON-LD Structured Data - FAQ (if available) */} {faqSchema && ( )} ); }; export default SEO;