import React, { Fragment } from "react"; import { Descriptions, Grid, Typography } from "antd"; import ExclamationCircleOutlined from "@ant-design/icons/ExclamationCircleOutlined"; import * as lib from "@clusterio/lib"; const { useBreakpoint } = Grid; type ModDetailsProps = { mod: T; actions?: (mod: T) => React.JSX.Element; }; export default function ModDetails(props: ModDetailsProps) { let screens = useBreakpoint(); const mod: Partial & Partial = props.mod; return {mod.error && Error} span={2} > {mod.error === "missing" && "The given version of this mod is missing from the controller storage."} {mod.error === "bad_checksum" && "Checksum of the mod in the controller storage does not match the checksum provided " + "by this mod pack." } } {props.actions && !screens.lg && {props.actions(props.mod)} } {Boolean(mod.title) && {mod.title}} {Boolean(mod.version) && {mod.version} } {Boolean(mod.description) && {mod.description} } {Boolean(mod.author) && {mod.author}} {`https://mods.factorio.com/mod/${mod.name}`} {Boolean(mod.contact) && {mod.contact}} {Boolean(mod.homepage) && {mod.homepage}} {mod.name} {Boolean(mod.factorioVersion) && {mod.factorioVersion} } {Boolean(mod.filename) && {mod.filename}} {mod.size !== undefined && {lib.formatBytes(mod.size)} } {Boolean(mod.sha1) && {mod.sha1}} {mod.dependencies && mod.dependencies.length && {mod.dependencies .filter(e => !e.startsWith("(?)")) .map((e, i) => {e}
) }
}
; }