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

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

import FeaturesSection from '../../components/WebPageComponents/FeaturesComponent';

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

import FaqSection from '../../components/WebPageComponents/FaqComponent';

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

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 features_points = [
    {
      name: 'Centralized Patient Management',
      description:
        'Easily manage patient records, appointments, and medical history in one place. Enhance patient care with quick access to vital information.',
      icon: 'mdiAccountCircle',
    },
    {
      name: 'Automated Billing \u0026 Insurance',
      description:
        'Streamline billing processes with automated invoice generation and insurance verification. Ensure accuracy and compliance with local regulations.',
      icon: 'mdiCashMultiple',
    },
    {
      name: 'Bilingual Support',
      description:
        'Offer seamless communication with full English and Arabic interfaces, including right-to-left layouts for Arabic users.',
      icon: 'mdiTranslate',
    },
  ];

  const faqs = [
    {
      question: 'What is ${projectName} and who is it for?',
      answer:
        '${projectName} is a multi-tenant web application designed for healthcare providers in Saudi Arabia, including clinics and hospitals, to streamline operations and enhance patient care.',
    },
    {
      question: 'How does ${projectName} ensure data security?',
      answer:
        '${projectName} employs robust security measures, including data isolation for each organization, role-based access control, and compliance with local regulations 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, ensuring seamless operations.',
    },
    {
      question: 'Is ${projectName} available in multiple languages?',
      answer:
        'Yes, ${projectName} offers bilingual support with full English and Arabic interfaces, including right-to-left layouts for Arabic users.',
    },
    {
      question:
        'What features does ${projectName} offer for patient management?',
      answer:
        '${projectName} provides centralized patient management, allowing easy access to medical records, appointment scheduling, and automated billing processes.',
    },
    {
      question: 'How can I get started with ${projectName}?',
      answer:
        'To get started, contact our team for a demo or sign up on our website to explore the features and benefits of ${projectName} for your healthcare organization.',
    },
  ];

  return (
    <div className='flex flex-col min-h-screen'>
      <Head>
        <title>{`Streamline Healthcare Operations with Our Multi-Tenant Web Application`}</title>
        <meta
          name='description'
          content={`Discover our innovative healthcare MVP designed to enhance patient care, streamline administrative tasks, and ensure compliance for healthcare providers in Saudi Arabia.`}
        />
      </Head>
      <WebSiteHeader projectName={'MediCore'} pages={pages} />
      <main className={`flex-grow    bg-white  rounded-none  `}>
        <HeroSection
          projectName={'MediCore'}
          image={['Healthcare professionals collaborating efficiently']}
          mainText={`Revolutionize Healthcare with ${projectName}`}
          subTitle={`${projectName} empowers healthcare providers in Saudi Arabia to streamline operations, enhance patient care, and ensure compliance with local standards. Experience seamless management of patient records, appointments, and billing.`}
          design={HeroDesigns.IMAGE_RIGHT || ''}
          buttonText={`Get Started Today`}
        />

        <FeaturesSection
          projectName={'MediCore'}
          image={['Doctors using digital tools']}
          withBg={0}
          features={features_points}
          mainText={`Explore ${projectName} Key Features`}
          subTitle={`Discover how ${projectName} transforms healthcare management with cutting-edge features designed for efficiency and compliance.`}
          design={FeaturesDesigns.CARDS_GRID_WITH_ICONS || ''}
        />

        <AboutUsSection
          projectName={'MediCore'}
          image={['Team collaborating on healthcare solutions']}
          mainText={`Empowering Healthcare with ${projectName}`}
          subTitle={`${projectName} is dedicated to revolutionizing healthcare management in Saudi Arabia. Our mission is to streamline operations, enhance patient care, and ensure compliance with local standards through innovative technology.`}
          design={AboutUsDesigns.IMAGE_LEFT || ''}
          buttonText={`Learn More About Us`}
        />

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

        <ContactFormSection
          projectName={'MediCore'}
          design={ContactFormDesigns.WITH_IMAGE || ''}
          image={['Healthcare professionals ready to assist']}
          mainText={`Get in Touch with ${projectName} `}
          subTitle={`Reach out to us anytime for inquiries or support. Our team is here to assist you with any questions about ${projectName}. Expect a prompt response within 24 hours.`}
        />
      </main>
      <WebSiteFooter projectName={'MediCore'} pages={pages} />
    </div>
  );
}

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