import Head from 'next/head';

// Componente para agregar datos estructurados específicos
const JsonLd = ({ data }) => {
  return (
    <Head>
      <script
        type="application/ld+json"
        dangerouslySetInnerHTML={{ __html: JSON.stringify(data) }}
      />
    </Head>
  );
};

// Datos estructurados predefinidos para diferentes tipos de páginas
export const organizationSchema = {
  "@context": "https://schema.org",
  "@type": "Organization",
  "name": "Sempreg Technology",
  "url": "https://suite.sempreg.com",
  "logo": "https://sempreg.com/wp-content/uploads/2021/09/cropped-simbolo-logo-e1723841306835.png",
  "description": "Soluciones tecnológicas especializadas para contabilidad y gestión empresarial en Colombia",
  "address": {
    "@type": "PostalAddress",
    "addressCountry": "CO",
    "addressLocality": "Colombia"
  },
  "contactPoint": {
    "@type": "ContactPoint",
    "contactType": "customer service",
    "availableLanguage": ["Spanish", "English"]
  },
  "sameAs": [
    "https://sempreg.com",
    "https://www.linkedin.com/company/sempreg"
  ],
  "foundingDate": "2010",
  "industry": "Software Development",
  "numberOfEmployees": "10-50"
};

export const softwareApplicationSchema = {
  "@context": "https://schema.org",
  "@type": "SoftwareApplication",
  "name": "Suite Sempreg",
  "description": "Software integral para gestión contable y financiera empresarial",
  "url": "https://suite.sempreg.com",
  "applicationCategory": "BusinessApplication",
  "operatingSystem": "Web Browser",
  "offers": {
    "@type": "Offer",
    "price": "0",
    "priceCurrency": "COP",
    "availability": "https://schema.org/InStock"
  },
  "author": {
    "@type": "Organization",
    "name": "Sempreg Technology"
  },
  "screenshot": "https://sempreg.com/wp-content/uploads/2025/07/Captura-de-pantalla-2025-07-22-164758.png",
  "featureList": [
    "Gestión contable automatizada",
    "Generación de informes financieros",
    "Importación masiva de datos",
    "Estados financieros automáticos",
    "Cumplimiento normativo DIAN"
  ]
};

export const webPageSchema = (title, description, url) => ({
  "@context": "https://schema.org",
  "@type": "WebPage",
  "name": title,
  "description": description,
  "url": url,
  "inLanguage": "es-CO",
  "isPartOf": {
    "@type": "WebSite",
    "name": "Suite Sempreg",
    "url": "https://suite.sempreg.com"
  },
  "author": {
    "@type": "Organization",
    "name": "Sempreg Technology"
  },
  "publisher": {
    "@type": "Organization",
    "name": "Sempreg Technology",
    "logo": {
      "@type": "ImageObject",
      "url": "https://sempreg.com/wp-content/uploads/2021/09/cropped-simbolo-logo-e1723841306835.png"
    }
  }
});

export const breadcrumbSchema = (items) => ({
  "@context": "https://schema.org",
  "@type": "BreadcrumbList",
  "itemListElement": items.map((item, index) => ({
    "@type": "ListItem",
    "position": index + 1,
    "name": item.name,
    "item": item.url
  }))
});

export default JsonLd;