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

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

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

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

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

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: 'Seamless Account Management',
      description:
        'Effortlessly manage your cooperative account with real-time updates and detailed transaction history. Stay informed and in control of your finances.',
      icon: 'mdiAccountCircle',
    },
    {
      name: 'Flexible Borrowing Options',
      description:
        'Choose from a variety of borrowing options tailored to your needs, whether for operational expenses, investments, or purchases. Empower your financial decisions.',
      icon: 'mdiCashMultiple',
    },
    {
      name: 'Community Project Collaboration',
      description:
        'Engage with fellow members on community projects, share ideas, and contribute to cooperative growth. Foster innovation and collective success.',
      icon: 'mdiHandshakeOutline',
    },
  ];

  const testimonials = [
    {
      text: "Joining ${projectName} has transformed our cooperative experience. 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 borrowing options offered by ${projectName} have empowered us to make strategic financial decisions. It's a game-changer 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 community project collaboration feature has sparked innovation and strengthened our bonds.',
      company: 'Unity Builders Ltd.',
      user_name: 'Emily Johnson, Project Coordinator',
    },
    {
      text: "The seamless account management on ${projectName} keeps us informed and in control. It's a must-have 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>{`Yarkoop - Cooperative Platform for Mutual Assistance and Business`}</title>
        <title>{`YarKoop - Cooperative Platform for Mutual Assistance and Business`}</title>
          name='description'
          content={`Welcome to Yarkoop, a cooperative platform dedicated to mutual assistance and business collaboration. Discover our features, learn about our mission, and connect with us today.`}
        />
      </Head>
      <WebSiteHeader projectName={'yarkoop'} />
      <main
        className={`flex-grow   bg-skyBlueTheme-websiteBG   rounded-none  `}
      >
        <HeroSection
          projectName={'yarkoop'}
          image={['Cooperative teamwork and growth']}
          mainText={`Empower Your Future with ${projectName}`}
          subTitle={`${projectName} is your gateway to cooperative success, fostering mutual assistance and business growth. Join us to unlock new opportunities and strengthen community ties.`}
          design={HeroDesigns.IMAGE_BG || ''}
          buttonText={`Join Us Now`}
        />

        <FeaturesSection
          projectName={'yarkoop'}
          image={['Icons representing key features']}
          withBg={1}
          features={features_points}
          mainText={`${projectName}'un temel özelliklerini keşfedin`}
          subTitle={`Explore the powerful features of ${projectName} designed to enhance cooperation and business growth.`}
          design={FeaturesDesigns.CARDS_GRID_WITH_ICONS || ''}
        />

        <AboutUsSection
          projectName={'yarkoop'}
          image={['Cooperative members collaborating together']}
          mainText={`Unite and Thrive with ${projectName}`}
          subTitle={`${projectName} is dedicated to fostering a cooperative environment where mutual assistance and business growth are at the forefront. Join us in building a stronger community together.`}
          design={AboutUsDesigns.IMAGE_LEFT || ''}
          buttonText={`Learn More`}
        />

        <TestimonialsSection
          projectName={'yarkoop'}
          design={TestimonialsDesigns.MULTI_CARD_DISPLAY || ''}
          testimonials={testimonials}
          mainText={`What Our Members Say About ${projectName} `}
        />

        <ContactFormSection
          projectName={'yarkoop'}
          design={ContactFormDesigns.WITH_IMAGE || ''}
          image={['Contact form with email icon']}
          mainText={`Connect with ${projectName} Today `}
          subTitle={`Reach out to us anytime for inquiries or support. Our team at ${projectName} is here to assist you promptly and effectively.`}
        />
      </main>
      <WebSiteFooter projectName={'yarkoop'} />
    </div>
  );
}

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