import React, { useEffect, useState } from 'react';
import type { ReactElement } from 'react';
import Head from 'next/head';
import Link from 'next/link';
import { useAppSelector } from '../stores/hooks';
import LayoutGuest from '../layouts/Guest';
import WebSiteHeader from '../components/WebPageComponents/Header';
import WebSiteFooter from '../components/WebPageComponents/Footer';
import {
  HeroDesigns,
  FeaturesDesigns,
  PricingDesigns,
} from '../components/WebPageComponents/designs';

import HeroSection from '../components/WebPageComponents/HeroComponent';

import FeaturesSection from '../components/WebPageComponents/FeaturesComponent';

import PricingSection from '../components/WebPageComponents/PricingComponent';

export default function WebSite() {
  const cardsStyle = useAppSelector((state) => state.style.cardsStyle);
  const bgColor = useAppSelector((state) => state.style.bgLayoutColor);
  const projectName = 'Scanclean';

  useEffect(() => {
    const darkElement = document.querySelector('body .dark');
    if (darkElement) {
      darkElement.classList.remove('dark');
    }
  }, []);
  const pages = [
    {
      href: '/home',
      label: 'home',
    },

    {
      href: '/services',
      label: 'services',
    },

    {
      href: '/pricing',
      label: 'pricing',
    },
  ];

  const features_points = [
    {
      name: 'AI Image Enhancement',
      description:
        'Upload or scan an image to enhance its clarity and quality using advanced AI algorithms. Perfect for improving photos and graphics.',
      icon: 'mdiImageFilterHdr',
    },
    {
      name: 'QR Code Tools',
      description:
        "Generate custom QR codes with embedded text or images. Scan QR codes using your device's camera for quick access to information.",
      icon: 'mdiQrcodeScan',
    },
    {
      name: 'OCR Text Extraction',
      description:
        'Extract clean and editable text from images like documents or flyers. Simplify data entry and document management.',
      icon: 'mdiTextRecognition',
    },
  ];

  const pricing_features = {
    standard: {
      features: ['AI Image Enhancement', 'Basic QR Code Generation'],
      limited_features: [
        'Limited OCR Text Extraction',
        'Limited QR Code Scanning',
      ],
    },
    premium: {
      features: [
        'AI Image Enhancement',
        'Advanced QR Code Tools',
        'Full OCR Text Extraction',
      ],
      also_included: ['Priority Support', 'Custom QR Code Designs'],
    },
    business: {
      features: [
        'AI Image Enhancement',
        'Comprehensive QR Code Solutions',
        'Unlimited OCR Text Extraction',
        'Dedicated Account Manager',
      ],
    },
  };

  const description = {
    standard:
      'Ideal for individuals looking to enhance images and generate basic QR codes with limited text extraction capabilities.',
    premium:
      'Perfect for small startups or agencies needing advanced QR code tools and full text extraction, with added support and customization options.',
    business:
      'Designed for enterprises requiring comprehensive image processing solutions, unlimited features, and dedicated support.',
  };

  return (
    <div className='flex flex-col min-h-screen'>
      <Head>
        <title>{`AI Image Processing Tool - Enhance, Scan, Extract`}</title>
        <meta
          name='description'
          content={`Discover our AI-powered image processing tool offering free image enhancement, QR code scanning, and OCR text extraction. Sign up for premium features and elevate your image processing experience.`}
        />
      </Head>
      <WebSiteHeader projectName={'Scanclean'} pages={pages} />
      <main className={`flex-grow  ${bgColor}    rounded-none  `}>
        <HeroSection
          projectName={'Scanclean'}
          image={['AI enhancing an image']}
          mainText={`Transform Images with AI Magic`}
          subTitle={`Experience the power of ${projectName} to enhance images, scan QR codes, and extract text effortlessly. Sign up for premium features and elevate your image processing journey.`}
          design={HeroDesigns.IMAGE_BG || ''}
          buttonText={`Get Started Now`}
        />

        <FeaturesSection
          projectName={'Scanclean'}
          image={['Icons representing app features']}
          withBg={1}
          features={features_points}
          mainText={`Explore ${projectName} Features`}
          subTitle={`Unlock the full potential of your images with ${projectName}. Enhance, scan, and extract effortlessly.`}
          design={FeaturesDesigns.CARDS_GRID_WITH_ICONS || ''}
        />

        <PricingSection
          projectName={'Scanclean'}
          withBg={1}
          features={pricing_features}
          description={description}
        />
      </main>
      <WebSiteFooter projectName={'Scanclean'} pages={pages} />
    </div>
  );
}

WebSite.getLayout = function getLayout(page: ReactElement) {
  return <LayoutGuest>{page}</LayoutGuest>;
};
