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,
  PricingDesigns,
  FaqDesigns,
  ContactFormDesigns,
} from '../../components/WebPageComponents/designs';

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

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

import FaqSection from '../../components/WebPageComponents/FaqComponent';

import ContactFormSection from '../../components/WebPageComponents/ContactFormComponent';

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

  useEffect(() => {
    const darkElement = document.querySelector('body .dark');
    if (darkElement) {
      darkElement.classList.remove('dark');
    }
  }, []);

  const pricing_features = {
    standard: {
      features: ['Customizable Templates', 'Basic Analytics', 'Domain Mapping'],
      limited_features: ['Limited Blocks', 'No Custom Domain'],
    },
    premium: {
      features: ['Advanced Analytics', 'Custom Domain', 'Priority Support'],
      also_included: ['Unlimited Blocks', 'Access to All Templates'],
    },
    business: {
      features: [
        'Enterprise-Level Support',
        'Dedicated Account Manager',
        'Custom Integrations',
      ],
    },
  };

  const description = {
    standard:
      'Ideal for individuals looking to establish a personal online presence with essential features.',
    premium:
      'Perfect for small startups or agencies seeking advanced analytics and customization options.',
    business:
      'Designed for enterprises requiring comprehensive support and custom solutions.',
  };

  const faqs = [
    {
      question: 'What is ${projectName} and how does it work?',
      answer:
        '${projectName} is a biolink generator that allows you to create a personalized landing page with multiple links. It offers customizable templates, analytics, and domain mapping to enhance your online presence.',
    },
    {
      question: 'Can I use my own domain with ${projectName}?',
      answer:
        'Yes, with the Premium and Business plans, you can connect your custom domain to your biolink page, providing a professional look and feel.',
    },
    {
      question: 'What analytics features are available?',
      answer:
        '${projectName} provides detailed analytics, including visits, clicks, and referrer data, helping you understand your audience and optimize your content strategy.',
    },
    {
      question: 'Is there a free trial available?',
      answer:
        'Yes, we offer a free trial for new users to explore the features of ${projectName} before committing to a paid plan.',
    },
    {
      question: 'How can I upgrade or downgrade my plan?',
      answer:
        'You can easily upgrade or downgrade your plan from your account settings. Changes will take effect immediately, and any price differences will be adjusted in your billing cycle.',
    },
    {
      question: 'What support options are available?',
      answer:
        'Our Premium and Business plans include priority support, ensuring you receive timely assistance. Standard plan users can access our comprehensive help center and community forums.',
    },
    {
      question: 'Are there any limitations on the number of links I can add?',
      answer:
        'The Standard plan has a limit on the number of blocks you can add, while the Premium and Business plans offer unlimited blocks for greater flexibility.',
    },
  ];

  return (
    <div className='flex flex-col min-h-screen'>
      <Head>
        <title>{`Biolink SaaS Pricing Plans`}</title>
        <meta
          name='description'
          content={`Explore our flexible pricing plans tailored to meet your needs. Choose the perfect plan to enhance your online presence with Biolink SaaS.`}
        />
      </Head>
      <WebSiteHeader projectName={'KevinHall'} />
      <main className={`flex-grow    bg-white  rounded-none  `}>
        <HeroSection
          projectName={'KevinHall'}
          image={['Pricing plans comparison chart']}
          mainText={`Choose Your Perfect ${projectName} Plan`}
          subTitle={`Discover flexible pricing options tailored to your needs. Whether you're an individual or an enterprise, ${projectName} has the right plan for you.`}
          design={HeroDesigns.TEXT_CENTER || ''}
          buttonText={`View Plans`}
        />

        <PricingSection
          projectName={'KevinHall'}
          withBg={1}
          features={pricing_features}
          description={description}
        />

        <FaqSection
          projectName={'KevinHall'}
          design={FaqDesigns.ACCORDION || ''}
          faqs={faqs}
          mainText={`Frequently Asked Questions about ${projectName} `}
        />

        <ContactFormSection
          projectName={'KevinHall'}
          design={ContactFormDesigns.HIGHLIGHTED || ''}
          image={['Person using a laptop']}
          mainText={`Reach Out to ${projectName} Support `}
          subTitle={`We're here to help! Contact us anytime for inquiries or support. Our team at ${projectName} is ready to assist you promptly.`}
        />
      </main>
      <WebSiteFooter projectName={'KevinHall'} />
    </div>
  );
}

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