import { COMPANY_INFO } from '@/lib/constants';

export function OrganizationSchema() {
  const schema = {
    "@context": "https://schema.org",
    "@type": "Organization",
    "name": COMPANY_INFO.name,
    "alternateName": "诺瓦隆",
    "url": "https://www.novalon.cn",
    "logo": "https://www.novalon.cn/logo.svg",
    "description": "专注于企业数字化转型服务，提供软件开发、云计算、数据分析、信息安全等一站式解决方案",
    "foundingDate": "2026",
    "address": {
      "@type": "PostalAddress",
      "addressCountry": "CN",
      "addressLocality": "成都",
      "addressRegion": "四川省",
      "streetAddress": "成都市高新区"
    },
    "sameAs": [
      "https://www.novalon.cn"
    ]
  };

  return (
    <script
      type="application/ld+json"
      dangerouslySetInnerHTML={{ __html: JSON.stringify(schema) }}
    />
  );
}

export function WebsiteSchema() {
  const schema = {
    "@context": "https://schema.org",
    "@type": "WebSite",
    "name": COMPANY_INFO.name,
    "url": "https://www.novalon.cn",
    "potentialAction": {
      "@type": "SearchAction",
      "target": "https://www.novalon.cn/search?q={search_term_string}",
      "query-input": "required name=search_term_string"
    }
  };

  return (
    <script
      type="application/ld+json"
      dangerouslySetInnerHTML={{ __html: JSON.stringify(schema) }}
    />
  );
}

export function ServiceSchema() {
  const schema = {
    "@context": "https://schema.org",
    "@type": "Service",
    "serviceType": "企业数字化转型服务",
    "provider": {
      "@type": "Organization",
      "name": COMPANY_INFO.name
    },
    "description": "提供软件开发、云计算、数据分析、信息安全等一站式数字化转型解决方案",
    "areaServed": {
      "@type": "Country",
      "name": "China"
    }
  };

  return (
    <script
      type="application/ld+json"
      dangerouslySetInnerHTML={{ __html: JSON.stringify(schema) }}
    />
  );
}
