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

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

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

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

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

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

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

  const features_points = [
    {
      name: 'Comprehensive Stock Analysis',
      description:
        'Utilize AI to analyze fundamental, technical, and sentiment data for stocks in Nigeria and US markets. Gain a holistic view of stock potential.',
      icon: 'mdiChartLine',
    },
    {
      name: 'Top Undervalued Picks',
      description:
        'Access a curated list of the top five undervalued stocks, updated regularly to help you seize investment opportunities.',
      icon: 'mdiStarCircle',
    },
    {
      name: 'Interactive Price Charts',
      description:
        'View detailed stock price charts for 1 week, 1 month, or 3 months. Visualize trends and make data-driven decisions.',
      icon: 'mdiChartTimelineVariant',
    },
    {
      name: 'Investor Letters',
      description:
        'Receive personalized investor letters with stock recommendations and justifications, tailored to your investment strategy.',
      icon: 'mdiEmailOutline',
    },
    {
      name: 'Subscription Flexibility',
      description:
        'Choose between freemium and premium plans, with easy upgrades and secure payments via Stripe integration.',
      icon: 'mdiCreditCardOutline',
    },
    {
      name: 'Corporate User Management',
      description:
        'Super-admins can manage user accounts, assign access, and oversee subscription statuses for corporate users.',
      icon: 'mdiAccountGroupOutline',
    },
  ];

  const pricing_features = {
    standard: {
      features: [
        'Access to top 2 undervalued stocks',
        'Basic stock analysis tools',
      ],
      limited_features: ['Limited chart views', 'Basic investor letters'],
    },
    premium: {
      features: [
        'Access to top 5 undervalued stocks',
        'Advanced stock analysis tools',
        'Interactive price charts',
      ],
      also_included: [
        'Comprehensive investor letters',
        'Priority customer support',
      ],
    },
    business: {
      features: [
        'Unlimited stock analysis',
        'Corporate user management',
        'Custom investor reports',
        'Dedicated account manager',
      ],
    },
  };

  const description = {
    standard:
      'Ideal for individual investors looking to explore basic stock insights and identify potential opportunities.',
    premium:
      'Perfect for small businesses or startups seeking advanced analysis tools and comprehensive stock recommendations.',
    business:
      'Designed for enterprises requiring extensive stock analysis, corporate management features, and personalized support.',
  };

  return (
    <div className='flex flex-col min-h-screen'>
      <Head>
        <title>{`StockSageAI - Discover Undervalued Stocks with AI Insights`}</title>
      <title>{`StocksageAI - Discover Undervalued Stocks with AI Insights`}</title>
          content={`Explore StockSageAI, the AI-powered platform that analyzes stocks in Nigeria and US markets using fundamental, technical, and sentiment data to identify undervalued stocks poised for growth.`}
      content={`Explore StocksageAI, the AI-powered platform that analyzes stocks in Nigeria and US markets using fundamental, technical, and sentiment data to identify undervalued stocks poised for growth.`}
      </Head>
      <WebSiteHeader projectName={'StocksageAI'} />
      <main className={`flex-grow    bg-white  rounded-none  `}>
        <HeroSection
          projectName={'StocksageAI'}
          image={['AI analyzing stock charts']}
          mainText={`Unlock Stock Potential with ${projectName}`}
          subTitle={`${projectName} leverages AI to analyze stocks in Nigeria and US markets, identifying undervalued opportunities for rapid growth. Discover your next investment today.`}
          design={HeroDesigns.IMAGE_RIGHT || ''}
          buttonText={`Get Started Now`}
        />

        <FeaturesSection
          projectName={'StocksageAI'}
          image={['AI-driven stock analysis']}
          withBg={1}
          features={features_points}
          mainText={`Explore ${projectName} Features`}
          subTitle={`Discover how ${projectName} empowers investors with AI-driven insights and tools to make informed decisions.`}
          design={FeaturesDesigns.CARDS_GRID_WITH_ICONS || ''}
        />

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

        <AboutUsSection
          projectName={'StocksageAI'}
          image={['Team collaborating on stock analysis']}
          mainText={`Empowering Investors with ${projectName}`}
          subTitle={`At ${projectName}, we harness the power of AI to provide investors with unparalleled insights into the stock market. Our mission is to simplify investment decisions and maximize growth potential.`}
          design={AboutUsDesigns.IMAGE_LEFT || ''}
          buttonText={`Learn More About Us`}
        />
      </main>
      <WebSiteFooter projectName={'StocksageAI'} />
    </div>
  );
}

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