diff --git a/src/10th/Roster.jsx b/src/10th/Roster.jsx index 05b7bcb..94fb7b1 100644 --- a/src/10th/Roster.jsx +++ b/src/10th/Roster.jsx @@ -22,6 +22,25 @@ import { ImgEditor } from "./ImgEditor"; import { trySettingLocalStorage } from "../helpers/useLocalStorage"; import { ShortSummaryTable } from "./ShortSummaryTable"; +const getShortSummarySubtitle = (force) => { + const details = []; + if (force.forceDisposition) { + details.push(force.forceDisposition); + } + if (force.detachments?.length) { + details.push( + force.detachments + .map( + (detachment) => + `${detachment.name} (${detachment.detachmentPoints} DP)`, + ) + .join(", "), + ); + } + + return details.join(" - "); +}; + export const Roster = ({ roster, onePerPage, @@ -43,6 +62,7 @@ export const Roster = ({ diff --git a/src/10th/ShortSummaryTable.jsx b/src/10th/ShortSummaryTable.jsx index 59ce0b3..e87084a 100644 --- a/src/10th/ShortSummaryTable.jsx +++ b/src/10th/ShortSummaryTable.jsx @@ -118,7 +118,7 @@ const getUnitTotalOc = (unit) => 0, ) || 0; -export const ShortSummaryTable = ({ force, primaryColor, name, points }) => { +export const ShortSummaryTable = ({ force, primaryColor, name, subtitle, points }) => { const [hide, setHide] = useState(false); const { units, factionRules, rules, catalog } = force; @@ -230,7 +230,23 @@ export const ShortSummaryTable = ({ force, primaryColor, name, points }) => { textTransform: "uppercase", }} > - {name} + {subtitle ? ( + + {name} + + {subtitle} + + + ) : ( + {name} + )} {points} pts
{
-
+