import { Metadata } from 'next';
import { LandingPage } from '@/components/landing/LandingPage';

export const metadata: Metadata = {
  title: 'QuitTraq - Track Your Journey to Quit Smoking & Marijuana',
  description: 'Free app to track nicotine and marijuana usage. Health recovery timeline, achievements, savings tracker. PWA works offline. Your companion to a healthier life.',
  keywords: ['quit smoking', 'stop smoking app', 'nicotine tracker', 'marijuana tracker', 'health recovery', 'quit vaping', 'substance tracker'],
  authors: [{ name: 'QuitTraq' }],
  openGraph: {
    type: 'website',
    locale: 'en_US',
    url: 'https://quittraq.com/home',
    title: 'QuitTraq - Track Your Journey to Quit Smoking',
    description: 'Free app to track nicotine and marijuana usage with health timeline and achievements.',
    siteName: 'QuitTraq',
    images: [
      {
        url: '/og-image.png',
        width: 1200,
        height: 630,
        alt: 'QuitTraq - Quit Smoking App',
      },
    ],
  },
  twitter: {
    card: 'summary_large_image',
    title: 'QuitTraq - Track Your Journey to Quit Smoking',
    description: 'Free app to track nicotine and marijuana usage with health timeline and achievements.',
    images: ['/og-image.png'],
  },
  robots: {
    index: true,
    follow: true,
    googleBot: {
      index: true,
      follow: true,
    },
  },
};

export default function HomePage() {
  const jsonLd = {
    '@context': 'https://schema.org',
    '@type': 'WebApplication',
    name: 'QuitTraq',
    description: 'Track your journey to quit smoking and marijuana',
    applicationCategory: 'HealthApplication',
    operatingSystem: 'Any',
    offers: {
      '@type': 'Offer',
      price: '0',
      priceCurrency: 'USD',
    },
  };

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