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

Function RenderReportCell

apps/OpenSign/src/primitives/RenderReportCell.jsx:28–185  ·  view source on GitHub ↗
({
  col,
  rowData,
  rowIndex,
  startIndex,
  handleDownload,
  handleRemovePrefill,
  reportName,
  handleItemClick
})

Source from the content-addressed store, hash-verified

26};
27// Renders a report cell based on the report's heading position
28export const RenderReportCell = ({
29 col,
30 rowData,
31 rowIndex,
32 startIndex,
33 handleDownload,
34 handleRemovePrefill,
35 reportName,
36 handleItemClick
37}) => {
38 const { t } = useTranslation();
39 const appName =
40 "OpenSign™";
41 const drivename = appName === "OpenSign™" ? "OpenSign™" : "";
42 switch (col) {
43 case "Sr.No":
44 return (
45 <th key={col} className="px-2 py-2">
46 {startIndex + rowIndex + 1}
47 </th>
48 );
49 case "Name":
50 case "Title":
51 return (
52 <td key={col} className="p-2 min-w-56 max-w-56">
53 <div className="font-semibold break-words">{rowData?.Name}</div>
54 {rowData?.ExpiryDate?.iso && (
55 <div className="text-gray-500">
56 {t("expires")} {formatDateToDdMmmYyyy(rowData?.ExpiryDate?.iso)}
57 </div>
58 )}
59 </td>
60 );
61 case "Reason":
62 return (
63 <td
64 key={col}
65 className="p-2 text-center cursor-pointer"
66 onClick={() => handleItemClick(col, rowData?.DeclineReason)}
67 >
68 {rowData?.DeclineReason?.length > 25
69 ? rowData?.DeclineReason?.slice(0, 25) + "..."
70 : rowData?.DeclineReason || "-"}
71 </td>
72 );
73 case "Note":
74 return (
75 <td key={col} className="p-2 text-center">
76 <p
77 className="truncate w-[100px] cursor-pointer"
78 onClick={() => handleItemClick(col, rowData?.Note)}
79 >
80 {rowData?.Note || "-"}
81 </p>
82 </td>
83 );
84 case "Folder":
85 return (

Callers

nothing calls this directly

Calls 5

formatDateToDdMmmYyyyFunction · 0.90
toStringMethod · 0.80
handleDownloadFunction · 0.70
formatRowFunction · 0.70
handleItemClickFunction · 0.50

Tested by

no test coverage detected