Skip to content

Commit

Permalink
Table.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
wkrzywiec committed Nov 30, 2024
1 parent 7754696 commit c03252b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions services/mankkoo-ui/components/charts/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export default function Table({
<tr key={rowIndex} className={(defineRowClass(preparedData, rowIndex, boldLastRow, hasHeader))}>
{ rowData.map((cellData, cellIndex) => {

if (shouldAddColorCircleToCell(cellData, preparedData, rowIndex, boldLastRow)) {
if (shouldAddColorCircleToCell(preparedData, rowIndex, boldLastRow, cellData)) {
return <td key={rowIndex + "_" + cellIndex}><span className={styles.dot} style={{backgroundColor: cellData.replace(COLOR_CIRCLE_CELL_PATTERN, "")}}></span></td>
}

Expand Down Expand Up @@ -134,7 +134,7 @@ function shouldBoldFirstRow(data: string[][], rowIndex: number, hasHeader: boole
return hasHeader && rowIndex === 0;
}

function shouldAddColorCircleToCell(cellData?: string, data: string[][], rowIndex: number, boldLastRow: boolean) {
function shouldAddColorCircleToCell(data: string[][], rowIndex: number, boldLastRow: boolean, cellData?: string) {
return cellData?.includes(COLOR_CIRCLE_CELL_PATTERN) && !shouldBoldLastRow(data, rowIndex, boldLastRow)
}

Expand Down

0 comments on commit c03252b

Please sign in to comment.