import { type Locale } from '@/i18n/config';

interface JsonLdProps {
  locale: Locale;
}

export function PersonJsonLd({ locale }: JsonLdProps) {
  const baseUrl = process.env.NEXT_PUBLIC_SITE_URL || 'https://damjan-savic.com';

  const schema = {
    '@context': 'https://schema.org',
    '@type': 'Person',
    '@id': `${baseUrl}/#person`,
    name: 'Damjan Savić',
    givenName: 'Damjan',
    familyName: 'Savić',
    jobTitle: locale === 'de'
      ? 'AI & Automation Specialist | Fullstack Entwickler'
      : locale === 'sr'
      ? 'AI & Automation Specialist | Fullstack Developer'
      : 'AI & Automation Specialist | Fullstack Developer',
    description: locale === 'de'
      ? 'Entwicklung von KI-Agenten und Automatisierungslösungen. Von Voice-AI-Plattformen bis zu autonomen Web-Agenten.'
      : locale === 'sr'
      ? 'Razvoj AI agenata i rešenja za automatizaciju. Od voice AI platformi do autonomnih web agenata.'
      : 'Remote AI developer building AI agents and automation solutions for clients in USA, UK and Europe. From voice AI platforms to autonomous web agents.',
    url: baseUrl,
    image: `${baseUrl}/images/og-image.jpg`,
    email: 'info@damjan-savic.com',
    telephone: '+491756950979',
    address: {
      '@type': 'PostalAddress',
      addressLocality: locale === 'sr' ? 'Keln' : locale === 'en' ? 'Cologne' : 'Köln',
      addressRegion: 'NRW',
      addressCountry: 'DE',
    },
    sameAs: [
      'https://www.linkedin.com/in/damjansavic/',
      'https://github.com/damjansavic',
    ],
    knowsAbout: [
      'Artificial Intelligence',
      'Machine Learning',
      'Process Automation',
      'Voice AI',
      'Web Development',
      'Python',
      'TypeScript',
      'React',
      'Next.js',
      'n8n',
      'SaaS Development',
    ],
    alumniOf: [
      {
        '@type': 'EducationalOrganization',
        name: 'FOM Hochschule für Ökonomie & Management',
      },
    ],
    hasCredential: [
      {
        '@type': 'EducationalOccupationalCredential',
        name: 'M.A. Software Development',
        credentialCategory: 'degree',
      },
      {
        '@type': 'EducationalOccupationalCredential',
        name: 'B.Sc. Wirtschaftsinformatik',
        credentialCategory: 'degree',
      },
    ],
  };

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