2022-02-27 07:25:34 +00:00
|
|
|
import Head from "next/head";
|
|
|
|
import React from "react";
|
|
|
|
|
|
|
|
import styles from "../styles/PluginData.module.css";
|
2022-03-12 19:00:40 +00:00
|
|
|
import { formatBytes } from "../lib/plugins";
|
2022-02-27 07:25:34 +00:00
|
|
|
|
2022-03-11 04:41:43 +00:00
|
|
|
export interface Plugin {
|
2022-03-12 19:00:40 +00:00
|
|
|
hash: string;
|
2022-03-11 04:41:43 +00:00
|
|
|
size: number;
|
|
|
|
author?: string;
|
|
|
|
description?: string;
|
|
|
|
masters: string[];
|
|
|
|
file_name: string;
|
2022-03-12 19:00:40 +00:00
|
|
|
cell_count: number;
|
2022-02-27 07:25:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type Props = {
|
2022-03-11 04:41:43 +00:00
|
|
|
plugin: Plugin;
|
2022-02-27 07:25:34 +00:00
|
|
|
};
|
|
|
|
|
2022-09-03 06:51:57 +00:00
|
|
|
const PluginData: React.FC<Props> = ({ plugin }) => {
|
2022-02-27 07:25:34 +00:00
|
|
|
if (!plugin) {
|
2022-03-11 04:41:43 +00:00
|
|
|
return <h3>Plugin could not be found.</h3>;
|
2022-02-27 07:25:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<Head>
|
2022-03-11 04:41:43 +00:00
|
|
|
<title key="title">{`Modmapper - ${plugin.file_name}`}</title>
|
2022-02-27 07:25:34 +00:00
|
|
|
<meta
|
|
|
|
key="description"
|
|
|
|
name="description"
|
2022-03-12 19:00:40 +00:00
|
|
|
content={`Map of Skyrim showing ${plugin.cell_count} cell edits from the plugin: ${plugin.file_name}`}
|
2022-02-27 07:25:34 +00:00
|
|
|
/>
|
|
|
|
<meta
|
|
|
|
key="og:title"
|
|
|
|
property="og:title"
|
2022-03-11 04:41:43 +00:00
|
|
|
content={`Modmapper - ${plugin.file_name}`}
|
2022-02-27 07:25:34 +00:00
|
|
|
/>
|
|
|
|
<meta
|
|
|
|
key="og:description"
|
|
|
|
property="og:description"
|
2022-03-12 19:00:40 +00:00
|
|
|
content={`Map of Skyrim showing ${plugin.cell_count} cell edits from the plugin: ${plugin.file_name}`}
|
2022-02-27 07:25:34 +00:00
|
|
|
/>
|
|
|
|
<meta
|
|
|
|
key="twitter:title"
|
|
|
|
name="twitter:title"
|
2022-03-11 04:41:43 +00:00
|
|
|
content={`Modmapper - ${plugin.file_name}`}
|
2022-02-27 07:25:34 +00:00
|
|
|
/>
|
|
|
|
<meta
|
|
|
|
key="twitter:description"
|
|
|
|
name="twitter:description"
|
2022-03-12 19:00:40 +00:00
|
|
|
content={`Map of Skyrim showing ${plugin.cell_count} cell edits from the plugin: ${plugin.file_name}`}
|
2022-02-27 07:25:34 +00:00
|
|
|
/>
|
|
|
|
<meta
|
|
|
|
key="og:url"
|
|
|
|
property="og:url"
|
|
|
|
content={`https://modmapper.com/?plugin=${plugin.hash}`}
|
|
|
|
/>
|
|
|
|
</Head>
|
2022-03-11 04:41:43 +00:00
|
|
|
<h1 className={styles.name}>{plugin.file_name}</h1>
|
|
|
|
{plugin.author && (
|
2022-02-27 07:25:34 +00:00
|
|
|
<div>
|
|
|
|
<strong>Author: </strong>
|
2022-03-11 04:41:43 +00:00
|
|
|
{plugin.author}
|
2022-02-27 07:25:34 +00:00
|
|
|
</div>
|
|
|
|
)}
|
2022-03-11 04:41:43 +00:00
|
|
|
{plugin.masters.length > 0 && (
|
2022-02-27 07:25:34 +00:00
|
|
|
<div>
|
|
|
|
<strong>Master plugins: </strong>
|
2022-03-11 04:41:43 +00:00
|
|
|
{plugin.masters.join(", ")}
|
2022-02-27 07:25:34 +00:00
|
|
|
</div>
|
|
|
|
)}
|
2022-03-12 19:00:40 +00:00
|
|
|
<div>
|
|
|
|
<strong>Size: </strong>
|
|
|
|
{formatBytes(plugin.size)}
|
|
|
|
</div>
|
2022-03-11 04:41:43 +00:00
|
|
|
<div>
|
|
|
|
<strong>Cell edits: </strong>
|
2022-03-12 19:00:40 +00:00
|
|
|
{plugin.cell_count}
|
2022-03-11 04:41:43 +00:00
|
|
|
</div>
|
2022-08-19 23:37:38 +00:00
|
|
|
{plugin.description ? (
|
2022-02-27 07:25:34 +00:00
|
|
|
<div>
|
|
|
|
<h3>Description:</h3>
|
2022-03-11 04:41:43 +00:00
|
|
|
<p>{plugin.description}</p>
|
2022-02-27 07:25:34 +00:00
|
|
|
</div>
|
2022-08-19 23:37:38 +00:00
|
|
|
) : (
|
|
|
|
<div className={styles.spacer} />
|
2022-02-27 07:25:34 +00:00
|
|
|
)}
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default PluginData;
|