Fixed mypy complaints

This commit is contained in:
2024-01-07 14:02:23 +01:00
parent bd30682092
commit 6535422148
15 changed files with 473 additions and 336 deletions

View File

@@ -1,9 +1,6 @@
"use client";
import { useEffect, useMemo, useRef, useState } from "react";
import {
ClientTableConfig,
ServiceTableConfig,
} from "@/config/client_1";
import { ClientTableConfig, ServiceTableConfig } from "@/config/client_1";
import CustomTable from "@/components/table";
import {
Alert,

View File

@@ -25,7 +25,7 @@ const CustomTable = ({ configuration, data, loading, key }: ICustomTable) => {
render?: (param: any) => void | undefined,
) => {
let renderedValue = value;
console.log(cellKey)
console.log(cellKey);
// cover use case if the data is an array
if (Array.isArray(value)) renderedValue = value.join(", ");
@@ -56,12 +56,18 @@ const CustomTable = ({ configuration, data, loading, key }: ICustomTable) => {
<TableBody>
{data.map((data: any, rowIndex: number) => (
<StyledTableRow key={rowIndex}>
{configuration.map((column: CustomTableConfiguration, columnIndex: number) => {
const cellValue: any = data[column.key];
const cellKey = key + ":" + column.key + ":" + rowIndex;
const renderComponent = column?.render;
return renderTableCell(cellValue, cellKey + ":" + columnIndex, renderComponent);
})}
{configuration.map(
(column: CustomTableConfiguration, columnIndex: number) => {
const cellValue: any = data[column.key];
const cellKey = key + ":" + column.key + ":" + rowIndex;
const renderComponent = column?.render;
return renderTableCell(
cellValue,
cellKey + ":" + columnIndex,
renderComponent,
);
},
)}
</StyledTableRow>
))}
</TableBody>