diff --git a/src/assets/scripts/package-bottles.jsx b/src/assets/scripts/package-bottles.jsx new file mode 100644 index 0000000..8e10065 --- /dev/null +++ b/src/assets/scripts/package-bottles.jsx @@ -0,0 +1,68 @@ +function PackageBottles() { + const [bottles, setBottles] = React.useState(); + + React.useEffect(() => { + const url = window.location.pathname.replace('/+', 'https://app.tea.xyz/api/bottles/'); + fetch(url) + .then((res) => res.json()) + .then((res) => setBottles(res)); + }, []); + + if (!bottles) return null; + + const names = [...new Set(bottles.map((b) => b.name))]; + + return ( +
version | +darwin-aarch64 | +darwin-x86-64 | +linux-aarch64 | +linux-x86-64 | +
---|---|---|---|---|
{v} | +{available.has("darwin-aarch64") ? "✅" : "❌"} | +{available.has("darwin-x86-64") ? "✅" : "❌"} | +{available.has("linux-aarch64") ? "✅" : "❌"} | +{available.has("linux-x86-64") ? "✅" : "❌"} | +