Alex3742

Untitled

Sep 29th, 2023
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ```
  2. const columns = [
  3.     {
  4.         id: 'hours',
  5.         header: 'Hours',
  6.         columns:[
  7.              ...Array(reports.length ? reports[0].payslip['hours'].length : 0).fill(0).map((_, index) => {
  8.           return {
  9.             id: 'whatever',
  10.             header: (header) => {
  11.               return <CellContent align="right">how do I access the content of the object here?</CellContent>
  12.             }
  13.             ,
  14.             cell: (data) => {
  15.               return <CellContent align="right">
  16.                 {data.row.original.payslip['hours'][index].total}
  17.               </CellContent>
  18.             },
  19.           }
  20.         }),
  21.         ]
  22.     }
  23. ]
  24. ```
Advertisement
Add Comment
Please, Sign In to add comment