modmapper-web/components/CellList.tsx
Tyler Hallada a590dbd02c Add cell list to plugin detail page
Also add mod counts in parenthesis.
2022-03-14 21:55:52 -04:00

48 lines
1.2 KiB
TypeScript

import React from "react";
import Link from "next/link";
import styles from "../styles/ModCellList.module.css";
import type { CellCoord } from "./ModData";
const NEXUS_MODS_URL = "https://www.nexusmods.com/skyrimspecialedition";
type Props = {
cells: CellCoord[];
};
const CellList: React.FC<Props> = ({ cells }) => {
return (
cells && (
<>
<h2>Cells ({cells.length})</h2>
<ul className={styles["cell-list"]}>
{cells
// .sort((a, b) => b.unique_downloads - a.unique_downloads)
.map((cell) => (
<li
key={`cell-${cell.x},${cell.y}`}
className={styles["cell-list-item"]}
>
<div className={styles["cell-title"]}>
<strong>
<Link
href={`/?cell=${encodeURIComponent(
`${cell.x},${cell.y}`
)}`}
>
<a>
{cell.x}, {cell.y}
</a>
</Link>
</strong>
</div>
</li>
))}
</ul>
</>
)
);
};
export default CellList;