feat: download of specific mods

This commit is contained in:
Kentai Radiquum 2025-05-07 00:05:42 +05:00
parent 56569917c1
commit e44a961faa
Signed by: Radiquum
GPG key ID: 858E8EE696525EED
3 changed files with 107 additions and 10 deletions

View file

@ -18,6 +18,7 @@ export const ModTable = (props: {
mods: Mod[];
updatePack: () => void;
packID: string;
downloadMods: (mods: string[]) => void;
}) => {
const [selectedMods, setSelectedMods] = useState<string[]>([]);
@ -130,7 +131,10 @@ export const ModTable = (props: {
<TableCell>{mod.url}</TableCell>
<TableCell>
<div className="flex gap-2">
<Button size="sm">
<Button
size="sm"
onClick={() => props.downloadMods([mod.slug])}
>
Download <HiDownload className="ml-2 h-4 w-4" />
</Button>
<Button
@ -154,14 +158,23 @@ export const ModTable = (props: {
<TableCell></TableCell>
<TableCell></TableCell>
<TableCell>
<Button
color={"red"}
size="sm"
disabled={selectedMods.length == 0}
onClick={() => deleteSelectedMods()}
>
Delete Selected <HiTrash className="ml-2 h-4 w-4" />
</Button>
<div className="flex gap-2">
<Button
size="sm"
disabled={selectedMods.length == 0}
onClick={() => props.downloadMods(selectedMods)}
>
Download Selected <HiDownload className="ml-2 h-4 w-4" />
</Button>
<Button
color={"red"}
size="sm"
disabled={selectedMods.length == 0}
onClick={() => deleteSelectedMods()}
>
Delete Selected <HiTrash className="ml-2 h-4 w-4" />
</Button>
</div>
</TableCell>
</TableRow>
</TableBody>