import { format } from "date-fns"; import React from "react"; import Link from "next/link"; import styles from "../styles/PluginModList.module.css"; import type { Mod } from "./CellData"; import type { File } from "../slices/plugins"; import { formatBytes } from "../lib/plugins"; const NEXUS_MODS_URL = "https://www.nexusmods.com/skyrimspecialedition"; type Props = { mods: Mod[]; files: File[]; counts: Record | null; }; type ModWithCounts = Mod & { total_downloads: number; unique_downloads: number; views: number; }; const PluginModList: React.FC = ({ mods, files, counts }) => { const modsWithCounts: ModWithCounts[] = mods.map((mod) => { const modCounts = counts && counts[mod.nexus_mod_id]; return { ...mod, total_downloads: modCounts ? modCounts[0] : 0, unique_downloads: modCounts ? modCounts[1] : 0, views: modCounts ? modCounts[2] : 0, }; }); let numberFmt = new Intl.NumberFormat("en-US"); return ( mods && ( <>

Nexus Mods ({modsWithCounts.length})

) ); }; export default PluginModList;