From 4c15b77d21e7cfa02d972999bdab81d777089605 Mon Sep 17 00:00:00 2001 From: nickofolas Date: Mon, 2 May 2022 17:05:25 -0500 Subject: [PATCH] Update `StatsRow` --- src/ui/React/StatsRow.tsx | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/ui/React/StatsRow.tsx b/src/ui/React/StatsRow.tsx index 405abcc26..030670791 100644 --- a/src/ui/React/StatsRow.tsx +++ b/src/ui/React/StatsRow.tsx @@ -16,19 +16,21 @@ interface IProps { name: string; color: string; classes?: any; - data: ITableRowData; + data?: ITableRowData; children?: React.ReactElement; } export const StatsRow = ({ name, color, classes = useStyles(), children, data }: IProps): React.ReactElement => { - let content; + let content = ""; - if (data.content !== undefined) { - content = data.content; - } else if (data.level !== undefined && data.exp !== undefined) { - content = `${formatNumber(data.level, 0)} (${numeralWrapper.formatExp(data.exp)} exp)`; - } else if (data.level !== undefined && data.exp === undefined) { - content = `${formatNumber(data.level, 0)}`; + if (data) { + if (data.content !== undefined) { + content = data.content; + } else if (data.level !== undefined && data.exp !== undefined) { + content = `${formatNumber(data.level, 0)} (${numeralWrapper.formatExp(data.exp)} exp)`; + } else if (data.level !== undefined && data.exp === undefined) { + content = `${formatNumber(data.level, 0)}`; + } } return (