---
import Layout from '@layouts/Layout.astro';
import Button from '@components/form/Button.astro';

import MainCard from '@components/scafold/MainCard.astro';

---

<Layout title="API Docs | Awesome Privacy">

  <MainCard>
    <div id="swagger-ui"></div>
    <div class="go">
      <Button url="https://api.awesome-privacy.xyz" text="Try it Out" />
    </div>
  </MainCard>

</Layout>

<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/4.1.3/swagger-ui.css">
<script is:inline src="https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/4.1.3/swagger-ui-bundle.js"></script>
<script type="module" is:inline>
  window.onload = () => {
    SwaggerUIBundle({
      url: 'https://raw.githubusercontent.com/Lissy93/awesome-privacy/main/api/open-api-spec.yml',
      dom_id: '#swagger-ui',
      deepLinking: true,
      presets: [
        SwaggerUIBundle.presets.apis,
        SwaggerUIBundle.SwaggerUIStandalonePreset
      ],
      plugins: [
        SwaggerUIBundle.plugins.DownloadUrl
      ]
    });
  }
</script>

<style lang="scss">
  .go {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
  }
</style>
