Skip to content

Commit

Permalink
get from release
Browse files Browse the repository at this point in the history
  • Loading branch information
ofrades committed Apr 6, 2024
1 parent 52ca5e2 commit 982a25e
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 40 deletions.
50 changes: 50 additions & 0 deletions src/components/Download.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
import { Icon, LinkCard, CardGrid, Card } from "@astrojs/starlight/components";
const data: { name: string; browser_download_url: string }[] = await fetch(
"https://api.github.com/repos/tesourofieis/tesourofieis/releases/latest"
)
.then((data) => data.json())
.then((data) => data.assets);
---

{data && (
<Card>
<div class="flex flex-wrap not-content justify-between align-middle m-3">
<a href="https://play.google.com/store/apps/details?id=com.tesourofieis.app">
<Icon name="rocket" />
Android
</a>

<a href={data.find(({ name }) => name.endsWith("_x64.dmg"))?.browser_download_url}>
<Icon name="apple" />
.dmg
</a>

<a href={data.find(({ name }) => name.includes("_x64-setup.exe"))?.browser_download_url}>
<Icon name="seti:windows" />
.exe
</a>

<a href={data.find(({ name }) => name.endsWith("_x64_en-US.msi"))?.browser_download_url}>
<Icon name="seti:windows" />
.msi
</a>

<a href={data.find(({ name }) => name.endsWith(".deb"))?.browser_download_url}>
<Icon name="linux" />
.deb
</a>

<a href={data.find(({ name }) => name.endsWith(".rpm"))?.browser_download_url}>
<Icon name="linux" />
.rpm
</a>

<a href={data.find(({ name }) => name.endsWith(".AppImage"))?.browser_download_url}>
<Icon name="linux" />
.AppImage
</a>
</div>
</Card>
)}
39 changes: 0 additions & 39 deletions src/components/Download.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion src/content/docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ banner:

import { Card, CardGrid, LinkCard } from "@astrojs/starlight/components";

import Download from "../../components/Download";
import Download from "../../components/Download.astro";

<Download />

Expand Down

0 comments on commit 982a25e

Please sign in to comment.