import Heading from '@theme/Heading';
import clsx from 'clsx';
import type { ReactNode } from 'react';
import styles from './styles.module.css';

type FeatureItem = {
  title: string;
  image: string;
  description: ReactNode;
};

const FeatureList: FeatureItem[] = [
  {
    title: 'Easy to Use',
    image: './img/easy.png',
    description: (
      <>
        Use the sidebar menu to quickly find the topics you need — whether you're setting up your first project or exploring advanced features
      </>
    ),
  },
  {
    title: 'Focus on What Matters',
    image: './img/focus.png',
    description: (
      <>
        You'll find practical examples, step-by-step instructions, and detailed explaination, so you can focus on building your HTML5 slot game with confidence and speed.
      </>
    ),
  },
  {
    title: 'Beginner Friendly',
    image: './img/friendly.png',
    description: (
      <>
        Designed for beginners, it takes care of the complex logic so you can focus on building your game. With just a few lines of code, you’ll have a working slot machine ready to go!
      </>
    ),
  },
];

function Feature({ title, image, description }: FeatureItem)
{
  return (
    <div className={clsx('col col--4')}>
      <div className="text--center">
        <img src={image} className={styles.featureImage} role="img" />
      </div>
      <div className="text--center padding-horiz--md">
        <Heading as="h3">{title}</Heading>
        <p>{description}</p>
      </div>
    </div>
  );
}

export default function HomepageFeatures(): ReactNode
{
  return (
    <section className={styles.features}>
      <div className="container">
        <div className="row">
          {FeatureList.map((props, idx) => (
            <Feature key={idx} {...props} />
          ))}
        </div>
      </div>
    </section>
  );
}
