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

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 = '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: 'What is the main purpose of ${projectName}?',
      answer:
        '${projectName} is designed to streamline healthcare operations for providers in Saudi Arabia, enhancing patient care and ensuring compliance with local standards.',
    },
    {
      question: 'How does ${projectName} handle data security?',
      answer:
        '${projectName} employs robust security measures, including data isolation for each organization and role-based access control, to protect sensitive information.',
    },
    {
      question: 'Can ${projectName} integrate with existing systems?',
      answer:
        'Yes, ${projectName} supports integration with third-party systems like NPHIES for insurance verification and Sahl AI for voice-to-text conversion.',
    },
    {
      question: 'Is there a trial version available for ${projectName}?',
      answer:
        'Yes, we offer a trial version for healthcare providers to explore the features and benefits of ${projectName} before committing to a subscription.',
    },
    {
      question: 'How can I get support for ${projectName}?',
      answer:
        'Our support team is available via email and contact form. We strive to respond to all inquiries within 24 hours to ensure timely assistance.',
    },
  ];

  return (
    <div className='flex flex-col min-h-screen'>
      <Head>
        <title>{`Frequently Asked Questions - ${projectName}`}</title>
        <meta
          name='description'
          content={`Find answers to common questions about our multi-tenant healthcare application. Learn more about features, pricing, and support for ${projectName}.`}
        />
      </Head>
      <WebSiteHeader projectName={'MediCore'} pages={pages} />
      <main className={`flex-grow    bg-white  rounded-none  `}>
        <HeroSection
          projectName={'MediCore'}
          image={['People discussing healthcare solutions']}
          mainText={`Your ${projectName} Questions Answered`}
          subTitle={`Explore our comprehensive FAQ section to find answers to common questions about ${projectName}. Whether it's about features, pricing, or support, we've got you covered.`}
          design={HeroDesigns.IMAGE_BG || ''}
          buttonText={`Explore FAQs`}
        />

        <FaqSection
          projectName={'MediCore'}
          design={FaqDesigns.SPLIT_LIST || ''}
          faqs={faqs}
          mainText={`${projectName} Frequently Asked Questions `}
        />
      </main>
      <WebSiteFooter projectName={'MediCore'} pages={pages} />
    </div>
  );
}

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