import Head from "next/head"; import React from "react"; import { useAppSelector } from "../lib/hooks"; import styles from "../styles/PluginData.module.css"; export interface CellCoord { x: number; y: number; } const NEXUS_MODS_URL = "https://www.nexusmods.com/skyrimspecialedition"; type Props = { hash: string; counts: Record | null; }; const PluginData: React.FC = ({ hash, counts }) => { const plugins = useAppSelector((state) => state.plugins.plugins); const plugin = plugins.find((plugin) => plugin.hash === hash); if (!plugin) { return

Plugin could not be found

; } return ( <> {`Modmapper - ${plugin.filename}`}

{plugin.filename}

{plugin.parsed && (
Version:  {plugin.parsed.header.version}
)} {plugin.parsed && plugin.parsed.header.author && (
Author:  {plugin.parsed.header.author}
)} {plugin.parsed && plugin.parsed.header.masters && (
Master plugins:  {plugin.parsed.header.masters.join(", ")}
)} {plugin.parsed && (
Cell edits:  {plugin.parsed.cells.length}
)} {plugin.parsed && (
World edits:  {plugin.parsed.worlds.length}
)} {plugin.parsed && plugin.parsed.header.description && (

Description:

{plugin.parsed.header.description}

)} {plugin.parseError && (

Failed to parse plugin:

{plugin.parseError}

)} ); }; export default PluginData;