import Head from "next/head"; import React from "react"; import styles from "../styles/PluginData.module.css"; import { formatBytes } from "../lib/plugins"; export interface Plugin { hash: string; size: number; author?: string; description?: string; masters: string[]; file_name: string; cell_count: number; } type Props = { plugin: Plugin; counts: Record | null; }; const PluginData: React.FC = ({ plugin, counts }) => { if (!plugin) { return

Plugin could not be found.

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

{plugin.file_name}

{plugin.author && (
Author:  {plugin.author}
)} {plugin.masters.length > 0 && (
Master plugins:  {plugin.masters.join(", ")}
)}
Size:  {formatBytes(plugin.size)}
Cell edits:  {plugin.cell_count}
{plugin.description && (

Description:

{plugin.description}

)} ); }; export default PluginData;