import clsx from 'clsx';
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import Layout from '@theme/Layout';
import HomepageFeatures from '@site/src/components/HomepageFeatures';
import Heading from '@theme/Heading';

import styles from './index.module.css';

function HomepageHeader() {
  const { siteConfig } = useDocusaurusContext();
  return (
    <header className={clsx('hero hero--primary', styles.heroBanner)}>
      <div className="container">
        <Heading as="h1" className="hero__title">
          {siteConfig.title}
        </Heading>
        <p className="hero__subtitle">{siteConfig.tagline}</p>
      </div>
    </header>
  );
}

export default function Home(): JSX.Element {
  const { siteConfig } = useDocusaurusContext();
  return (
    <Layout
      title={siteConfig.title}
      description="Free and Open Soruce software to assist the organization of weddings">
      <HomepageHeader />
      <main>
        <h2 className={styles.h2}>Features</h2>

        <HomepageFeatures />
        <h2 className={styles.h2}>Free & Open Source Software</h2>
        <section className={styles.project}>
          <p>
            This project was created to help individuals organize their own wedding, without the need to rely on proprietary software or services.
            We firmly believe that the data related to your wedding should be owned by you, and not by a third party. For that reason, our
            recommendation is that you host your own instance of Libre Wedding Planner, either at home, on your own server or on a cloud provider
            of your choice.
          </p>
          <p>
            However, we are well aware that most users don't have the technical skills or resources to host their own instance. For that reason,
            we are working on a hosted version of Libre Wedding Planner you will be able to use <em>as a service</em> for free (as long as we can
            afford the server costs). Still, we encourage you to not use this service if you can host your own instance. We don't care, and don't 
            need to know how much you're going to spend, or who your guests are.
          </p>
          <p>
            Libre Wedding Planner is free (as in freedom), open source software, licensed under the AGPLv3. You are free to download the source code, use it,
            modify it, and distribute it according to the license terms. Please, find links to the source code in the footer of this page.
          </p>
        </section>
      </main>
    </Layout>
  );
}
