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

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

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

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

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

    {
      href: '/faq',
      label: 'FAQ',
    },
  ];

  const features_points = [
    {
      name: 'Task Management',
      description:
        'Effortlessly create, assign, and track tasks to ensure your projects stay on schedule. Simplify task delegation and monitor progress with ease.',
      icon: 'mdiClipboardCheck',
    },
    {
      name: 'Real-Time Collaboration',
      description:
        'Enhance team communication with real-time updates and seamless collaboration. Keep everyone on the same page and boost productivity.',
      icon: 'mdiAccountGroup',
    },
    {
      name: 'Comprehensive Reporting',
      description:
        'Gain insights with detailed reports and analytics. Make informed decisions and optimize project performance with data-driven insights.',
      icon: 'mdiChartLine',
    },
  ];

  const faqs = [
    {
      question: 'What is ${projectName} and how does it work?',
      answer:
        '${projectName} is a project management tool designed to streamline task tracking and enhance team collaboration. It allows users to create, assign, and monitor tasks efficiently.',
    },
    {
      question: 'How can I get started with ${projectName}?',
      answer:
        'To get started, sign up for an account on our website. Once registered, you can create projects, add team members, and start managing tasks right away.',
    },
    {
      question: 'Is there a free trial available for ${projectName}?',
      answer:
        'Yes, we offer a 14-day free trial for new users. This allows you to explore all the features and see how ${projectName} can benefit your team.',
    },
    {
      question: 'Can I integrate ${projectName} with other tools?',
      answer:
        'Absolutely! ${projectName} supports integrations with popular tools like Slack, Google Drive, and more to enhance your workflow and productivity.',
    },
    {
      question: 'What support options are available for ${projectName} users?',
      answer:
        'We offer 24/7 customer support via email and live chat. Our team is always ready to assist you with any questions or issues you may encounter.',
    },
    {
      question: 'How secure is my data with ${projectName}?',
      answer:
        'We prioritize your data security with robust encryption and regular backups. Your information is safe and accessible only to authorized users.',
    },
    {
      question: "Can I customize ${projectName} to fit my team's needs?",
      answer:
        'Yes, ${projectName} offers customizable features and settings to tailor the platform to your specific project management requirements.',
    },
  ];

  return (
    <div className='flex flex-col min-h-screen'>
      <Head>
        <title>{`Project Management Software - Efficient Task Tracking & Collaboration`}</title>
        <meta
          name='description'
          content={`Discover our innovative project management software designed to streamline task tracking, enhance team collaboration, and boost productivity. Ideal for project managers, developers, and testers.`}
        />
      </Head>
      <WebSiteHeader projectName={'g56g65g56g56g56'} pages={pages} />
      <main className={`flex-grow    bg-white  rounded-none  `}>
        <HeroSection
          projectName={'g56g65g56g56g56'}
          image={['Team collaborating on project tasks']}
          mainText={`Revolutionize Project Management with ${projectName}`}
          subTitle={`hello Ian!`}
          design={HeroDesigns.IMAGE_RIGHT || ''}
          buttonText={`Get Started Now`}
        />

        <FeaturesSection
          projectName={'g56g65g56g56g56'}
          image={['Dashboard showcasing project progress']}
          withBg={0}
          features={features_points}
          mainText={`Unlock Efficiency with ${projectName} Features`}
          subTitle={`Explore the powerful features of ${projectName} designed to streamline your project management and enhance team collaboration.`}
          design={FeaturesDesigns.CARDS_GRID_WITH_ICONS || ''}
        />

        <AboutUsSection
          projectName={'g56g65g56g56g56'}
          image={['Team brainstorming innovative solutions']}
          mainText={`Discover the Vision Behind ${projectName}`}
          subTitle={`At ${projectName}, we are committed to transforming the way teams manage projects. Our mission is to provide intuitive tools that enhance productivity and foster collaboration.`}
          design={AboutUsDesigns.IMAGE_LEFT || ''}
          buttonText={`Learn More About Us`}
        />

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

        <ContactFormSection
          projectName={'g56g65g56g56g56'}
          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 and effectively.`}
        />
      </main>
      <WebSiteFooter projectName={'g56g65g56g56g56'} pages={pages} />
    </div>
  );
}

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