fixed cors issues
All checks were successful
checks-impure / test (pull_request) Successful in 30s
checks / test (pull_request) Successful in 1m15s

This commit is contained in:
2024-01-07 14:56:06 +01:00
parent 6535422148
commit 74fbb7890c
9 changed files with 41 additions and 30 deletions

View File

@@ -11,7 +11,7 @@ import { StyledTableCell, StyledTableRow } from "./style";
import { ICustomTable, CustomTableConfiguration } from "@/types";
import { Checkbox, Skeleton } from "@mui/material";
const CustomTable = ({ configuration, data, loading, key }: ICustomTable) => {
const CustomTable = ({ configuration, data, loading, tkey }: ICustomTable) => {
if (loading)
return <Skeleton variant="rectangular" animation="wave" height={200} />;
@@ -25,7 +25,7 @@ const CustomTable = ({ configuration, data, loading, key }: ICustomTable) => {
render?: (param: any) => void | undefined,
) => {
let renderedValue = value;
console.log(cellKey);
// cover use case if the data is an array
if (Array.isArray(value)) renderedValue = value.join(", ");
@@ -36,6 +36,7 @@ const CustomTable = ({ configuration, data, loading, key }: ICustomTable) => {
// cover use case if we want to render a component
if (render) renderedValue = render(value);
console.log("renderTableCell key", cellKey);
return (
<StyledTableCell key={cellKey} align="left">
{renderedValue}
@@ -59,7 +60,7 @@ const CustomTable = ({ configuration, data, loading, key }: ICustomTable) => {
{configuration.map(
(column: CustomTableConfiguration, columnIndex: number) => {
const cellValue: any = data[column.key];
const cellKey = key + ":" + column.key + ":" + rowIndex;
const cellKey = tkey + ":" + column.key + ":" + rowIndex;
const renderComponent = column?.render;
return renderTableCell(
cellValue,