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

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

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

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

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

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

  useEffect(() => {
    const darkElement = document.querySelector('body .dark');
    if (darkElement) {
      darkElement.classList.remove('dark');
    }
  }, []);

  const features_points = [
    {
      name: 'Comprehensive Member Management',
      description:
        'Easily manage member profiles, track participation, and facilitate seamless communication within the cooperative. Enhance member engagement and satisfaction.',
      icon: 'mdiAccountGroup',
    },
    {
      name: 'Dynamic Financial Tools',
      description:
        'Access a suite of financial tools tailored for cooperatives, including budgeting, expense tracking, and financial reporting. Make informed decisions with ease.',
      icon: 'mdiFinance',
    },
    {
      name: 'Collaborative Project Platform',
      description:
        'Foster innovation and teamwork with a platform that supports collaborative projects. Share ideas, track progress, and achieve collective goals.',
      icon: 'mdiLightbulbGroupOutline',
    },
  ];

  const testimonials = [
    {
      text: "${projectName} has been a game-changer for our cooperative. The platform's intuitive design and robust features have streamlined our operations and fostered a sense of community.",
      company: 'Coop Innovators Inc.',
      user_name: 'Jane Doe, Operations Manager',
    },
    {
      text: "The financial tools offered by ${projectName} have empowered us to make strategic decisions. It's a must-have for any cooperative looking to grow.",
      company: 'Green Future Co.',
      user_name: 'John Smith, Financial Director',
    },
    {
      text: 'We love how ${projectName} brings our members together. The collaborative project platform has sparked innovation and strengthened our bonds.',
      company: 'Unity Builders Ltd.',
      user_name: 'Emily Johnson, Project Coordinator',
    },
    {
      text: "The seamless member management on ${projectName} keeps us informed and in control. It's an essential tool for any cooperative.",
      company: 'Harmony Ventures',
      user_name: 'Michael Brown, Account Manager',
    },
    {
      text: "${projectName} has revolutionized our approach to cooperative management. The platform's user-friendly interface and comprehensive features are unmatched.",
      company: 'Synergy Solutions',
      user_name: 'Sarah Lee, CEO',
    },
    {
      text: "Our cooperative has thrived since adopting ${projectName}. The platform's focus on mutual assistance and growth aligns perfectly with our values.",
      company: 'Collective Growth Partners',
      user_name: 'David Wilson, Community Leader',
    },
  ];

  return (
    <div className='flex flex-col min-h-screen'>
      <Head>
        <title>{`About Yarkoop - Our Mission and Vision`}</title>
        <meta
          name='description'
          content={`Learn more about Yarkoop, our mission to foster cooperative growth, and how we empower communities through mutual assistance and collaboration.`}
        />
      </Head>
      <WebSiteHeader projectName={'yarkoop'} />
      <main
        className={`flex-grow   bg-skyBlueTheme-websiteBG   rounded-none  `}
      >
        <HeroSection
          projectName={'yarkoop'}
          image={['Cooperative team working together']}
          mainText={`Discover the Heart of ${projectName}`}
          subTitle={`At ${projectName}, we are committed to building a cooperative future. Learn about our mission, values, and the impact we strive to make in communities worldwide.`}
          design={HeroDesigns.IMAGE_LEFT || ''}
          buttonText={`Explore Our Story`}
        />

        <AboutUsSection
          projectName={'yarkoop'}
          image={['Team collaborating on a project']}
          mainText={`Our Journey at ${projectName}`}
          subTitle={`${projectName} is more than a platform; it's a movement towards cooperative empowerment. Discover our journey, values, and the vision that drives us forward.`}
          design={AboutUsDesigns.IMAGE_RIGHT || ''}
          buttonText={`Learn More About Us`}
        />

        <FeaturesSection
          projectName={'yarkoop'}
          image={['Icons representing core features']}
          withBg={1}
          features={features_points}
          mainText={`Explore ${projectName} Core Features`}
          subTitle={`Discover the essential features that make ${projectName} a leader in cooperative solutions, designed to empower and connect communities.`}
          design={FeaturesDesigns.CARDS_GRID_WITH_ICONS || ''}
        />

        <TestimonialsSection
          projectName={'yarkoop'}
          design={TestimonialsDesigns.HORIZONTAL_CAROUSEL_DIVERSITY || ''}
          testimonials={testimonials}
          mainText={`Hear from Our ${projectName} Community `}
        />
      </main>
      <WebSiteFooter projectName={'yarkoop'} />
    </div>
  );
}

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