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

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

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

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 = 'BlackEconDev';

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

  const features_points = [
    {
      name: 'Advanced Search',
      description:
        'Easily find professionals by filtering through multiple tags. Quickly connect with the right expert in economic development.',
      icon: 'mdiMagnify',
    },
    {
      name: 'Profile Management',
      description:
        'Members can update their contact information and profile picture anytime, ensuring their details are always current.',
      icon: 'mdiAccountEdit',
    },
    {
      name: 'Admin Control',
      description:
        'Admins can manage users, create new tags, and oversee site settings, maintaining a seamless user experience.',
      icon: 'mdiShieldAccount',
    },
  ];

  return (
    <div className='flex flex-col min-h-screen'>
      <Head>
        <title>{`Connect with Experts in Economic Development`}</title>
        <meta
          name='description'
          content={`Discover and connect with professionals in economic development. Create an account, update your profile, and explore our database of experts.`}
        />
      </Head>
      <WebSiteHeader projectName={'BlackEconDev'} />
      <main className={`flex-grow  ${bgColor}    rounded-none  `}>
        <HeroSection
          projectName={'BlackEconDev'}
          image={['Diverse professionals collaborating']}
          mainText={`Connect with Leading Experts Effortlessly`}
          subTitle={`Explore our extensive database to find and connect with top professionals in economic development. Join ${projectName} today to update your profile and stay ahead.`}
          design={HeroDesigns.IMAGE_BG || ''}
          buttonText={`Enter Database`}
        />

        <FeaturesSection
          projectName={'BlackEconDev'}
          image={['Icons representing diverse features']}
          withBg={1}
          features={features_points}
          mainText={`Discover the Power of ${projectName}`}
          subTitle={`Unlock the potential of your network with ${projectName}. Explore features designed to connect, update, and manage effortlessly.`}
          design={FeaturesDesigns.CARDS_GRID_WITH_ICONS || ''}
        />

        <AboutUsSection
          projectName={'BlackEconDev'}
          image={['Team collaborating on a project']}
          mainText={`Empowering Connections with ${projectName}`}
          subTitle={`At ${projectName}, we bridge the gap between professionals and opportunities in economic development. Our platform is designed to foster meaningful connections and streamline profile management.`}
          design={AboutUsDesigns.IMAGE_RIGHT || ''}
          buttonText={`Learn More About Us`}
        />

        <ContactFormSection
          projectName={'BlackEconDev'}
          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={'BlackEconDev'} />
    </div>
  );
}

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