MCPcopy Index your code
hub / github.com/OpenSignLabs/OpenSign / formatStatusRow

Function formatStatusRow

apps/OpenSign/src/primitives/SignerCell.jsx:30–111  ·  view source on GitHub ↗
(item)

Source from the content-addressed store, hash-verified

28 };
29 // `formatStatusRow` is used to format status row
30 const formatStatusRow = (item) => {
31 const timezone = extClass?.[0]?.Timezone || "";
32 const DateFormat = extClass?.[0]?.DateFormat || "MM/DD/YYYY";
33 const Is12Hr = extClass?.[0]?.Is12HourTime || false;
34 const removePrefill = item?.Placeholders.filter(
35 (data) => data?.Role !== "prefill"
36 );
37 const signers = removePrefill?.map((x, i) => {
38 const audit = item?.AuditTrail?.find(
39 (audit) => audit?.UserPtr?.objectId === x.signerObjId
40 );
41 const format = (date) =>
42 date
43 ? formatDateTime(new Date(date), DateFormat, timezone, Is12Hr)
44 : "-";
45 return {
46 id: i,
47 Email: getSignerEmail(x, item?.Signers) || x?.email || "-",
48 Activity: audit?.Activity?.toUpperCase() || "SENT",
49 SignedOn: format(audit?.SignedOn),
50 ViewedOn: format(audit?.ViewedOn)
51 };
52 });
53 // Decide how many signers to display based on `showAllSignes` state
54 const displaySigners = isShowAllSigners[item.objectId]
55 ? signers
56 : signers.slice(0, 3);
57 return (
58 <>
59 {displaySigners?.map((x, i) => (
60 <div
61 key={i}
62 className={`text-sm flex flex-row gap-2 items-center ${
63 i !== displaySigners.length - 1 ? "mb-2" : ""
64 }`}
65 >
66 {!isCompletedReport && (
67 <button
68 onClick={() => setIsModal({ [`${item.objectId}_${i}`]: true })}
69 className={`${
70 x.Activity === "SIGNED"
71 ? "op-border-primary op-text-primary"
72 : x.Activity === "VIEWED"
73 ? "border-green-400 text-green-400"
74 : "border-base-content text-base-content"
75 } focus:outline-none border-2 w-[60px] h-[30px] text-[11px] rounded-full`}
76 >
77 {x?.Activity?.toUpperCase() || "-"}
78 </button>
79 )}
80 <div className="text-[12px]">{x?.Email || "-"}</div>
81 {!isCompletedReport && isModal[`${item.objectId}_${i}`] && (
82 <ModalUi
83 isOpen
84 title={t("document-logs")}
85 handleClose={handleCloseModal}
86 >
87 <div className="pl-3 first:mt-2 border-t-[1px] border-gray-600 text-[12px] py-2">

Callers 1

SignerCellFunction · 0.85

Calls 2

getSignerEmailFunction · 0.90
formatFunction · 0.85

Tested by

no test coverage detected