MCPcopy Create free account
hub / github.com/OpenSignLabs/OpenSign / formatRow

Function formatRow

apps/OpenSign/src/primitives/RenderReportCell.jsx:13–26  ·  view source on GitHub ↗
(row)

Source from the content-addressed store, hash-verified

11// if data is of object type then it Name values will be show in row
12// if no data available it will show hyphen "-"
13const formatRow = (row) => {
14 if (Array.isArray(row)) {
15 return row.map((x) => x.Name).join(", ");
16 } else if (typeof row === "object" && row !== null) {
17 return row?.iso ? formatDateToDdMmmYyyy(row?.iso) : row?.Name || "-";
18 } else if (typeof row === "boolean" && row !== null) {
19 return row ? row?.toString() : "false";
20 } else if (isValidDateString(row) && row !== null) {
21 // handle createdAt and updatedAt
22 return formatDateToDdMmmYyyy(row) || "-";
23 } else {
24 return row || "-";
25 }
26};
27// Renders a report cell based on the report's heading position
28export const RenderReportCell = ({
29 col,

Callers 1

RenderReportCellFunction · 0.70

Calls 3

formatDateToDdMmmYyyyFunction · 0.90
isValidDateStringFunction · 0.85
toStringMethod · 0.80

Tested by

no test coverage detected