
import Script from 'next/script';

export function StructuredData() {
  const structuredData = {
    '@context': 'https://schema.org',
    '@type': 'SoftwareApplication',
    name: 'Quote2Contract CRM',
    applicationCategory: 'BusinessApplication',
    offers: {
      '@type': 'Offer',
      price: '0',
      priceCurrency: 'USD',
    },
    aggregateRating: {
      '@type': 'AggregateRating',
      ratingValue: '4.8',
      ratingCount: '127',
    },
    operatingSystem: 'Web',
    description: 'Complete CRM solution for home services contractors specializing in roofing, pools, gutters, and irrigation systems.',
    author: {
      '@type': 'Organization',
      name: 'Quote2Contract',
    },
    featureList: [
      'Quote Management',
      'Contract Generation',
      'Customer Portal',
      'Calendar Sync',
      'GPS Tracking',
      'E-Signature',
      'Analytics Dashboard',
      'Contractor Performance',
    ],
  };

  const organizationData = {
    '@context': 'https://schema.org',
    '@type': 'Organization',
    name: 'Quote2Contract',
    description: 'Professional CRM platform for home services contractors',
    url: process.env.NEXTAUTH_URL || 'https://quote2contract-crm-7yqnrl.abacusai.app',
    logo: '/logo-large.png',
    contactPoint: {
      '@type': 'ContactPoint',
      contactType: 'customer support',
      email: 'support@quote2contract.com',
    },
    sameAs: [],
  };

  return (
    <>
      <Script
        id="structured-data-software"
        type="application/ld+json"
        dangerouslySetInnerHTML={{
          __html: JSON.stringify(structuredData),
        }}
      />
      <Script
        id="structured-data-organization"
        type="application/ld+json"
        dangerouslySetInnerHTML={{
          __html: JSON.stringify(organizationData),
        }}
      />
    </>
  );
}
