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

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

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

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

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

  const faqs = [
    {
      question: 'How do I contact ${projectName} support?',
      answer:
        'You can contact our support team via the contact form on this page or by emailing us directly. We are available 24/7 to assist you.',
    },
    {
      question: 'What is the response time for inquiries?',
      answer:
        'Our team strives to respond to all inquiries within 24 hours. We prioritize urgent issues to ensure timely assistance.',
    },
    {
      question: 'Can I request a demo of ${projectName}?',
      answer:
        'Yes, we offer personalized demos to help you understand how ${projectName} can benefit your team. Contact us to schedule a session.',
    },
    {
      question: 'How do I report a technical issue?',
      answer:
        'If you encounter any technical issues, please use the contact form to provide details. Our technical team will address the problem promptly.',
    },
    {
      question: 'Is there a community forum for ${projectName} users?',
      answer:
        'Yes, we have an active community forum where users can share experiences, ask questions, and provide feedback. Join the conversation today!',
    },
  ];

  return (
    <div className='flex flex-col min-h-screen'>
      <Head>
        <title>{`Contact Us - ${projectName}`}</title>
        <meta
          name='description'
          content={`Get in touch with the ${projectName} team for inquiries, support, or feedback. We're here to assist you with any questions you may have.`}
        />
      </Head>
      <WebSiteHeader projectName={'Adminpro'} />
      <main className={`flex-grow    bg-white  rounded-none  `}>
        <HeroSection
          projectName={'Adminpro'}
          image={['Customer support team assisting clients']}
          mainText={`Reach Out to ${projectName} Today`}
          subTitle={`We're here to help! Contact the ${projectName} team for any inquiries, support, or feedback. Your satisfaction is our priority.`}
          design={HeroDesigns.TEXT_CENTER || ''}
          buttonText={`Contact Us Now`}
        />

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

        <ContactFormSection
          projectName={'Adminpro'}
          design={ContactFormDesigns.WITH_IMAGE || ''}
          image={['Person typing on a laptop']}
          mainText={`Get in Touch with ${projectName} `}
          subTitle={`Feel free to reach out to us anytime. Our team is available 24/7 to respond to your queries and provide the support you need.`}
        />
      </main>
      <WebSiteFooter projectName={'Adminpro'} />
    </div>
  );
}

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