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

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

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

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

  const features_points = [
    {
      name: 'Centralized Dashboard',
      description:
        'Access all your management tools in one place. Monitor team performance and track key metrics effortlessly.',
      icon: 'mdiViewDashboard',
    },
    {
      name: 'Role-Based Access',
      description:
        'Assign specific roles and permissions to team members, ensuring secure and efficient data management.',
      icon: 'mdiAccountKey',
    },
    {
      name: 'Real-Time Collaboration',
      description:
        'Facilitate seamless communication and collaboration among team members with integrated chat and file sharing.',
      icon: 'mdiChat',
    },
  ];

  const faqs = [
    {
      question: 'What is ${projectName} and who is it for?',
      answer:
        "${projectName} is an admin portal designed for management teams to streamline operations, enhance collaboration, and manage data efficiently. It's ideal for businesses looking to optimize their management processes.",
    },
    {
      question: 'How does ${projectName} ensure data security?',
      answer:
        '${projectName} employs advanced encryption and role-based access controls to ensure that your data is secure and only accessible to authorized personnel.',
    },
    {
      question: 'Can I customize user roles in ${projectName}?',
      answer:
        'Yes, ${projectName} allows you to define and customize user roles, providing specific permissions and access levels to suit your organizational needs.',
    },
    {
      question: 'Is there a trial version available for ${projectName}?',
      answer:
        'Yes, we offer a free trial period for ${projectName} so you can explore its features and see how it fits your management needs before committing.',
    },
    {
      question: 'How can I get support if I encounter issues?',
      answer:
        'Our support team is available 24/7 to assist you. You can reach out via the contact form on our website or email us directly for prompt assistance.',
    },
    {
      question: 'Does ${projectName} integrate with other tools?',
      answer:
        'Yes, ${projectName} offers seamless integration with various third-party tools and platforms to enhance your workflow and productivity.',
    },
  ];

  return (
    <div className='flex flex-col min-h-screen'>
      <Head>
        <title>{`Admin Portal for Management Teams`}</title>
        <meta
          name='description'
          content={`Discover our comprehensive admin portal designed for management teams, offering robust features, seamless communication, and efficient data management.`}
        />
      </Head>
      <WebSiteHeader projectName={'society-community-portal'} />
      <main className={`flex-grow    bg-white  rounded-none  `}>
        <HeroSection
          projectName={'society-community-portal'}
          image={['Team collaborating in modern office']}
          mainText={`Empower Your Management with ${projectName}`}
          subTitle={`Streamline your team's operations with ${projectName}. Enhance efficiency, manage data seamlessly, and foster collaboration within your management team.`}
          design={HeroDesigns.IMAGE_RIGHT || ''}
          buttonText={`Get Started Now`}
        />

        <FeaturesSection
          projectName={'society-community-portal'}
          image={['Dashboard showcasing key metrics']}
          withBg={1}
          features={features_points}
          mainText={`Discover Key Features of ${projectName}`}
          subTitle={`Explore how ${projectName} enhances your management team's productivity with these powerful features.`}
          design={FeaturesDesigns.CARDS_GRID_WITH_ICONS || ''}
        />

        <AboutUsSection
          projectName={'society-community-portal'}
          image={['Team brainstorming in modern office']}
          mainText={`Unleashing Potential with ${projectName}`}
          subTitle={`At ${projectName}, we are dedicated to transforming management processes. Our mission is to empower teams with innovative tools and seamless solutions.`}
          design={AboutUsDesigns.IMAGE_LEFT || ''}
          buttonText={`Learn More About Us`}
        />

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

        <ContactFormSection
          projectName={'society-community-portal'}
          design={ContactFormDesigns.WITH_IMAGE || ''}
          image={['Person typing on a laptop']}
          mainText={`Connect with ${projectName} Today `}
          subTitle={`Reach out to us anytime. Our team is ready to assist you with any inquiries or support you need. Expect a prompt response from ${projectName}.`}
        />
      </main>
      <WebSiteFooter projectName={'society-community-portal'} />
    </div>
  );
}

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