import { MOD_ENDPOINT } from "@/api/ENDPOINTS"; import { Mod } from "@/types/mod"; import { Button, Checkbox, Table, TableBody, TableCell, TableHead, TableHeadCell, TableRow, } from "flowbite-react"; import { HiDownload, HiTrash } from "react-icons/hi"; import { toast } from "react-toastify"; export const ModTable = (props: { mods: Mod[]; updatePack: () => void; packID: string; }) => { async function deleteMod(slug: string, title: string) { if (!window) return; if (window.confirm(`Delete mod ${title}?`)) { const res = await fetch(MOD_ENDPOINT("deleteMod", props.packID, slug)); const data = await res.json(); if (data.status != "ok") { toast.error(data.message, { autoClose: 2500, closeOnClick: true, draggable: true, }); return; } props.updatePack(); } } return (