Skip to content

Commit

Permalink
Update CellTable.jsx
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnDuprey committed May 1, 2024
1 parent def6083 commit a3675bd
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions src/components/tables/CellTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,24 @@ export default function cellTable(
columnProp = column
}

if (!Array.isArray(columnProp) && typeof columnProp === 'object') {
columnProp = Object.keys(columnProp).map((key) => {
return {
Key: key,
Value: columnProp[key],
}
})
if (columnProp === undefined || columnProp === null) {
columnProp = []
} else {
if (Array.isArray(columnProp) && typeof columnProp[0] !== 'object') {
columnProp = columnProp.map((row) => {
if (!Array.isArray(columnProp) && typeof columnProp === 'object') {
columnProp = Object.keys(columnProp).map((key) => {
return {
Value: row,
Key: key,
Value: columnProp[key],
}
})
} else {
if (Array.isArray(columnProp) && typeof columnProp[0] !== 'object') {
columnProp = columnProp.map((row) => {
return {
Value: row,
}
})
}
}
}

Expand Down

0 comments on commit a3675bd

Please sign in to comment.