---
import DocsLayout from "@layouts/DocsLayout.astro";
import { getVersionsData } from "@config/io/generateTypeData";

export async function getStaticPaths() {
  return (await getVersionsData()).versions.map(version => ({
    params: { version: version.name },
    props: { version },
  }));
}

const { version } = Astro.props;
---
<DocsLayout title="Quickshell Module Listing" description="Quickshell Type Documentation">
  <div class="docs-content">
    <hr/>
    <h2>Module Listing</h2>
    <section>
      <span>All modules included with Quickshell</span>
      <div class="root-nav" data-pagefind-ignore>
        {version.modules.map(module => (
          <div class="root-nav-entry">
            <a class="root-nav-link" href={`/docs/${version.name}/types/${module.name}`}>
              {module.name}
            </a>
            <span class="root-nav-desc">{module.description}</span>
          </div>)
        )}
      </div>
    </section>
  </div>
</DocsLayout>
