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

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

import PricingSection from '../../components/WebPageComponents/PricingComponent';

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 pricing_features = {
    standard: {
      features: [
        'Patient Management',
        'Appointment Scheduling',
        'Basic EMR Access',
      ],
      limited_features: ['Limited Billing Features', 'Basic Support'],
    },
    premium: {
      features: [
        'Patient Management',
        'Appointment Scheduling',
        'Advanced EMR Access',
        'Billing \u0026 Insurance Integration',
      ],
      also_included: ['Priority Support', 'Customizable Workflows'],
    },
    business: {
      features: [
        'Full Patient Management',
        'Comprehensive EMR',
        'Advanced Billing \u0026 Insurance',
        'Multi-Tenant Support',
        'Dedicated Account Manager',
      ],
    },
  };

  const description = {
    standard:
      'The Standard plan is ideal for individual healthcare providers or small clinics looking to manage patient records and appointments efficiently.',
    premium:
      'The Premium plan is perfect for small to medium-sized healthcare businesses seeking advanced EMR capabilities and integrated billing solutions.',
    business:
      'The Business plan is designed for large healthcare enterprises requiring comprehensive management tools, multi-tenant support, and dedicated assistance.',
  };

  const faqs = [
    {
      question: 'What is included in the Standard plan?',
      answer:
        'The Standard plan includes essential features like Patient Management, Appointment Scheduling, and Basic EMR Access, suitable for individual providers or small clinics.',
    },
    {
      question: 'Can I upgrade from Standard to Premium?',
      answer:
        'Yes, you can easily upgrade from the Standard to the Premium plan at any time. Simply contact our support team to assist with the transition.',
    },
    {
      question: 'Is there a free trial available?',
      answer:
        'Yes, we offer a free trial for all plans. This allows you to explore the features and determine which plan best suits your needs before committing.',
    },
    {
      question: 'What support options are available?',
      answer:
        'Standard plan users receive basic support, while Premium and Business plan users enjoy priority support. Business plan users also have access to a dedicated account manager.',
    },
    {
      question: 'Are there any hidden fees?',
      answer:
        'No, all costs are transparent and outlined in the pricing plans. There are no hidden fees, and you will only be charged for the plan you select.',
    },
  ];

  return (
    <div className='flex flex-col min-h-screen'>
      <Head>
        <title>{`${projectName} Pricing Plans`}</title>
        <meta
          name='description'
          content={`Explore the flexible pricing plans for ${projectName}, designed to meet the needs of healthcare providers in Saudi Arabia. Choose the plan that best suits your organization.`}
        />
      </Head>
      <WebSiteHeader projectName={'MediCore'} pages={pages} />
      <main className={`flex-grow    bg-white  rounded-none  `}>
        <HeroSection
          projectName={'MediCore'}
          image={['Healthcare professionals discussing pricing']}
          mainText={`Affordable ${projectName} Pricing Plans`}
          subTitle={`Discover the flexible pricing options for ${projectName}, tailored to meet the diverse needs of healthcare providers. Choose a plan that aligns with your organization's goals and budget.`}
          design={HeroDesigns.IMAGE_RIGHT || ''}
          buttonText={`View Plans`}
        />

        <PricingSection
          projectName={'MediCore'}
          withBg={1}
          features={pricing_features}
          description={description}
        />

        <FaqSection
          projectName={'MediCore'}
          design={FaqDesigns.ACCORDION || ''}
          faqs={faqs}
          mainText={`${projectName} Pricing FAQs `}
        />
      </main>
      <WebSiteFooter projectName={'MediCore'} pages={pages} />
    </div>
  );
}

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