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

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

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

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

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

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

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

    {
      href: '/pricing',
      label: 'pricing',
    },
  ];

  const faqs = [
    {
      question: 'How can I contact ${projectName} support?',
      answer:
        'You can reach out to our support team via the contact form on this page. We are available to assist you with any inquiries or issues you may have.',
    },
    {
      question: 'What is the response time for inquiries?',
      answer:
        'Our team strives to respond to all inquiries within 24 hours. We prioritize urgent matters to ensure timely assistance.',
    },
    {
      question: 'Can I schedule a demo of ${projectName}?',
      answer:
        'Yes, you can request a demo through our contact form. Our team will get in touch to arrange a convenient time for you.',
    },
    {
      question: 'Is there a support hotline available?',
      answer:
        'Currently, we provide support through email and our contact form. We are working on expanding our support channels to include a hotline in the future.',
    },
    {
      question: 'How do I report a technical issue?',
      answer:
        'To report a technical issue, please use the contact form to provide details about the problem. Our technical team will investigate and resolve it promptly.',
    },
  ];

  return (
    <div className='flex flex-col min-h-screen'>
      <Head>
        <title>{`Contact Us - Get in Touch with ${projectName}`}</title>
        <meta
          name='description'
          content={`Reach out to us for any inquiries or support related to our multi-tenant healthcare application. Our team is here to assist you with any questions you may have.`}
        />
      </Head>
      <WebSiteHeader projectName={'MediCore'} pages={pages} />
      <main className={`flex-grow    bg-white  rounded-none  `}>
        <HeroSection
          projectName={'MediCore'}
          image={['Customer support team ready to assist']}
          mainText={`Connect with ${projectName} Today`}
          subTitle={`Have questions or need assistance? Our team at ${projectName} is here to help you with any inquiries about our healthcare solutions. Reach out to us and let's start a conversation.`}
          design={HeroDesigns.TEXT_CENTER || ''}
          buttonText={`Contact Us Now`}
        />

        <FaqSection
          projectName={'MediCore'}
          design={FaqDesigns.ACCORDION || ''}
          faqs={faqs}
          mainText={`${projectName} Contact FAQs `}
        />

        <ContactFormSection
          projectName={'MediCore'}
          design={ContactFormDesigns.WITH_IMAGE || ''}
          image={['Team ready to assist you']}
          mainText={`Reach Out to ${projectName} Support `}
          subTitle={`We're here to assist you with any questions or support needs. Contact us anytime, and expect a prompt response from our dedicated team.`}
        />
      </main>
      <WebSiteFooter projectName={'MediCore'} pages={pages} />
    </div>
  );
}

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