import {
Menu,
ButtonGroup,
Button,
MenuButton,
IconButton,
MenuList,
MenuItem,
Link as Anchor,
} from "@chakra-ui/react";
import { Platform, usePlatform } from "hooks/usePlatform";
import React from "react";
import {
FaApple,
FaCaretDown,
FaUbuntu,
FaLinux,
FaWindows,
FaAndroid,
} from "react-icons/fa";
import { MdOutlineFileDownload } from "react-icons/md";
const baseURL = "https://github.com/KRTirtho/spotube/releases/latest/download/";
const DownloadLinks = Object.freeze({
[Platform.linux]: [
{
name: "deb",
url: baseURL + "Spotube-linux-x86_64.deb",
icon: ,
},
{
name: "tar",
url: baseURL + "Spotube-linux-x86_64.tar.xz",
icon: ,
},
{
name: "AppImage",
url: baseURL + "Spotube-linux-x86_64.AppImage",
icon: ,
},
],
[Platform.android]: [
{
name: "apk",
url: baseURL + "Spotube-android-all-arch.apk",
icon: ,
},
],
[Platform.mac]: [
{
name: "dmg",
url: baseURL + "Spotube-macos-x86_64.dmg",
icon: ,
},
],
[Platform.windows]: [
{
name: "exe",
url: baseURL + "Spotube-windows-x86_64-setup.exe",
icon: ,
},
{
name: "nupkg",
url: baseURL + "Spotube-windows-x86_64.nupkg ",
icon: ,
},
],
});
const DownloadButton = () => {
const platform = usePlatform();
const allPlatforms = Object.entries(Platform)
.map(([, value]) => {
return DownloadLinks[value].map((s) => ({
...s,
name: `${value} (.${s.name})`,
}));
})
.flat(1);
const currentPlatform = DownloadLinks[platform][0];
return (
);
};
export default DownloadButton;