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

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

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

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

export default function WebSite() {
  const cardsStyle = useAppSelector((state) => state.style.cardsStyle);
  const bgColor = useAppSelector((state) => state.style.bgLayoutColor);
  const projectName = 'Zynorix Solutions';

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

  return (
    <div className='flex flex-col min-h-screen'>
      <Head>
        <title>{`Contact ${projectName} for Inquiries`}</title>
        <meta
          name='description'
          content={`Get in touch with ${projectName} for any questions or support. Our team is here to assist you with your needs and provide timely responses.`}
        />
      </Head>
      <WebSiteHeader projectName={'Zynorix Solutions'} />
      <main className={`flex-grow  ${bgColor}    rounded-none  `}>
        <HeroSection
          projectName={'Zynorix Solutions'}
          image={['Customer service representative smiling']}
          mainText={`Connect with ${projectName} Today`}
          subTitle={`We're here to help! Reach out to ${projectName} for any inquiries or support. Our team is ready to assist you with prompt and friendly service.`}
          design={HeroDesigns.TEXT_CENTER || ''}
          buttonText={`Contact Us Now`}
        />

        <AboutUsSection
          projectName={'Zynorix Solutions'}
          image={['Team celebrating a milestone']}
          mainText={`Discover the Story Behind ${projectName}`}
          subTitle={`At ${projectName}, we are driven by innovation and a passion for excellence. Learn more about our journey and the values that guide us.`}
          design={AboutUsDesigns.IMAGE_LEFT || ''}
          buttonText={`Learn More About Us`}
        />

        <ContactFormSection
          projectName={'Zynorix Solutions'}
          design={ContactFormDesigns.HIGHLIGHTED || ''}
          image={['Person using a smartphone']}
          mainText={`Reach Out to ${projectName} `}
          subTitle={`Feel free to contact us anytime. ${projectName} is committed to providing timely responses to all your inquiries.`}
        />
        <section className="bg-white py-8">
          <div className="container mx-auto px-4 text-center">
            <h2 className="text-2xl font-bold mb-4">Contact Details</h2>
            <p className="mb-2">Address: Lado Sarai, Saket, New Delhi, 110030</p>
            <p className="mb-2">Phone: 9041253266</p>
            <p className="mb-2">Email: <a href="mailto:rishabh200602per@gmail.com" className="text-blue-500 hover:underline">rishabh200602per@gmail.com</a></p>
          </div>
        </section>

      </main>
      <WebSiteFooter projectName={'Zynorix Solutions'} />
    </div>
  );
}

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