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

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

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

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

import AboutUsSection from '../components/WebPageComponents/AboutUsComponent';

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 pages = [
    {
      href: '/home',
      label: 'home',
    },

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

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

  const features_points = [
    {
      name: 'Customizable Templates',
      description:
        "Choose from a variety of templates to match your brand's style. Easily customize colors, fonts, and layouts to create a unique biolink page.",
      icon: 'mdiPalette',
    },
    {
      name: 'Advanced Analytics',
      description:
        'Gain insights into your audience with detailed analytics. Track visits, clicks, and referrers to optimize your content strategy.',
      icon: 'mdiChartLine',
    },
    {
      name: 'Domain Mapping',
      description:
        'Connect your custom domain to your biolink page for a professional look. Enjoy seamless integration and SSL security.',
      icon: 'mdiDomain',
    },
  ];

  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.',
  };

  return (
    <div className='flex flex-col min-h-screen'>
      <Head>
        <title>{`Biolink SaaS - Your Ultimate Biolink Generator`}</title>
        <meta
          name='description'
          content={`Discover Biolink SaaS, the ultimate biolink generator with customizable templates, block builder, analytics, and custom domains. Elevate your online presence today!`}
        />
      </Head>
      <WebSiteHeader projectName={'KevinHall'} pages={pages} />
      <main className={`flex-grow    bg-white  rounded-none  `}>
        <HeroSection
          projectName={'KevinHall'}
          image={['Dynamic biolink generator interface']}
          mainText={`Elevate Your Online Presence with ${projectName}`}
          subTitle={`${projectName} offers a powerful biolink generator with customizable templates, block builder, and analytics. Transform your digital footprint effortlessly.`}
          design={HeroDesigns.IMAGE_RIGHT || ''}
          buttonText={`Get Started Now`}
        />

        <FeaturesSection
          projectName={'KevinHall'}
          image={['Biolink generator feature showcase']}
          withBg={1}
          features={features_points}
          mainText={`Discover ${projectName} Features`}
          subTitle={`Explore the powerful features of ${projectName} designed to enhance your online presence and streamline your digital strategy.`}
          design={FeaturesDesigns.CARDS_GRID_WITH_ICONS || ''}
        />

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

        <AboutUsSection
          projectName={'KevinHall'}
          image={['Team collaborating on digital solutions']}
          mainText={`Empowering Your Digital Journey with ${projectName}`}
          subTitle={`At ${projectName}, we are committed to transforming the way you connect online. Our innovative biolink solutions are designed to enhance your digital presence and drive engagement.`}
          design={AboutUsDesigns.IMAGE_LEFT || ''}
          buttonText={`Learn More About Us`}
        />

        <ContactFormSection
          projectName={'KevinHall'}
          design={ContactFormDesigns.WITH_IMAGE || ''}
          image={['Person typing on a laptop']}
          mainText={`Get in Touch with ${projectName} `}
          subTitle={`Reach out to us anytime for inquiries or support. Our team at ${projectName} is here to assist you promptly.`}
        />
      </main>
      <WebSiteFooter projectName={'KevinHall'} pages={pages} />
    </div>
  );
}

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