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 {
  ContactFormDesigns,
  HeroDesigns,
  FeaturesDesigns,
  TestimonialsDesigns,
  PricingDesigns,
} from '../components/WebPageComponents/designs';

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

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

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

import TestimonialsSection from '../components/WebPageComponents/TestimonialsComponent';

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

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

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

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

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

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

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

  const features_points = [
    {
      name: 'Smart Shift Scheduling',
      description:
        'Automate and optimize your shift planning with intelligent scheduling tools. Save time and reduce errors with recurring shifts and templates.',
      icon: 'mdiCalendarClock',
    },
    {
      name: 'Real-Time Notifications',
      description:
        'Stay informed with instant alerts for new shifts, approvals, and cancellations. Ensure seamless communication between employers and employees.',
      icon: 'mdiBellAlert',
    },
    {
      name: 'Predictive Scheduling',
      description:
        'Leverage historical data to predict high-demand times and optimize staffing. Make informed decisions with data-driven insights.',
      icon: 'mdiChartLine',
    },
  ];

  const testimonials = [
    {
      text: "WorkHive has transformed our scheduling process. It's intuitive and saves us hours every week!",
      company: 'Tech Solutions Inc.',
      user_name: 'Alex Johnson, Operations Manager',
    },
    {
      text: 'The predictive scheduling feature is a game-changer. We can now plan ahead with confidence.',
      company: 'Greenfield Logistics',
      user_name: 'Emily Carter, HR Director',
    },
    {
      text: 'Our team loves the real-time notifications. It keeps everyone in the loop and reduces no-shows.',
      company: 'Urban Eats',
      user_name: 'Michael Lee, Restaurant Owner',
    },
    {
      text: 'With WorkHive, managing multiple locations is a breeze. The analytics dashboard is incredibly insightful.',
      company: 'Retail Hub',
      user_name: 'Sophia Martinez, Regional Manager',
    },
    {
      text: 'The smart matching system ensures we always have the right people for the job. Highly recommend!',
      company: 'Event Masters',
      user_name: 'Daniel Kim, Event Coordinator',
    },
    {
      text: "WorkHive's automated payroll tracking has simplified our payment process. It's efficient and reliable.",
      company: 'Creative Studios',
      user_name: 'Olivia Brown, Finance Officer',
    },
  ];

  const pricing_features = {
    standard: {
      features: ['Smart Shift Scheduling', 'Real-Time Notifications'],
      limited_features: ['Predictive Scheduling', 'Employee Ratings'],
    },
    premium: {
      features: [
        'Smart Shift Scheduling',
        'Real-Time Notifications',
        'Predictive Scheduling',
      ],
      also_included: ['Employee Ratings', 'Automated Payroll Tracking'],
    },
    business: {
      features: [
        'Smart Shift Scheduling',
        'Real-Time Notifications',
        'Predictive Scheduling',
        'Employee Ratings',
        'Automated Payroll Tracking',
        'Analytics Dashboard',
      ],
    },
  };

  const description = {
    standard:
      'The Standard plan is perfect for individuals or small teams looking to streamline their shift scheduling and receive real-time updates.',
    premium:
      'The Premium plan is ideal for small businesses or startups that need advanced scheduling features and additional tools to enhance workforce management.',
    business:
      'The Business plan is designed for enterprises requiring comprehensive workforce management solutions with full access to all features and analytics.',
  };

  return (
    <div className='flex flex-col min-h-screen'>
      <Head>
        <title>{`WorkHive - Streamline Your Workforce Management`}</title>
        <meta
          name='description'
          content={`Discover WorkHive, the ultimate shift management platform designed to optimize workforce scheduling and enhance productivity across multiple locations. Join us to simplify your business operations.`}
        />
      </Head>
      <WebSiteHeader projectName={'workhive'} pages={pages} />
      <main className={`flex-grow    bg-white  rounded-none  `}>
        <HeroSection
          projectName={'workhive'}
          image={['Team collaborating on shift planning']}
          mainText={`Revolutionize Workforce Management with WorkHive`}
          subTitle={`Experience seamless shift scheduling and management with ${projectName}. Optimize your workforce across multiple locations effortlessly.`}
          design={HeroDesigns.IMAGE_RIGHT || ''}
          buttonText={`Get Started Now`}
        />

        <FeaturesSection
          projectName={'workhive'}
          image={['Dashboard displaying shift analytics']}
          withBg={1}
          features={features_points}
          mainText={`Discover WorkHive's Powerful Features`}
          subTitle={`Unlock the full potential of your workforce with ${projectName}. Streamline operations and enhance productivity effortlessly.`}
          design={FeaturesDesigns.CARDS_GRID_WITH_ICONS || ''}
        />

        <TestimonialsSection
          projectName={'workhive'}
          design={TestimonialsDesigns.HORIZONTAL_CAROUSEL || ''}
          testimonials={testimonials}
          mainText={`What Our Users Say About ${projectName} `}
        />

        <PricingSection
          projectName={'workhive'}
          withBg={0}
          features={pricing_features}
          description={description}
        />

        <ContactFormSection
          projectName={'workhive'}
          design={ContactFormDesigns.WITH_IMAGE || ''}
          image={['Person typing on a laptop']}
          mainText={`Get in Touch with ${projectName} `}
          subTitle={`Reach out to us anytime. Our team at ${projectName} is here to assist you with any inquiries or support needs.`}
        />
      </main>
      <WebSiteFooter projectName={'workhive'} pages={pages} />
    </div>
  );
}

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