Skip to content

Commit 6738816

Browse files
Merge pull request #2319 from JohnDuprey/dev
Celltable fix
2 parents add7a37 + 64a7f87 commit 6738816

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/components/tables/CellTable.jsx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,18 @@ export default function cellTable(
2828
) {
2929
columnProp = Object.keys(columnProp).map((key) => {
3030
return {
31-
[key]: columnProp[key],
32-
}
33-
})
34-
}
35-
36-
if (Array.isArray(columnProp) && typeof columnProp[0] !== 'object') {
37-
columnProp = columnProp.map((row) => {
38-
return {
39-
Value: row,
31+
Key: key,
32+
Value: columnProp[key],
4033
}
4134
})
35+
} else {
36+
if (Array.isArray(columnProp) && typeof columnProp[0] !== 'object') {
37+
columnProp = columnProp.map((row) => {
38+
return {
39+
Value: row,
40+
}
41+
})
42+
}
4243
}
4344

4445
const handleTable = ({ columnProp }) => {

0 commit comments

Comments
 (0)