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

Function SignerCell

apps/OpenSign/src/primitives/SignerCell.jsx:7–182  ·  view source on GitHub ↗
({ reportName, item, handleRemovePrefill })

Source from the content-addressed store, hash-verified

5
6// Signer is used in report to show signer list conditionally
7const SignerCell = ({ reportName, item, handleRemovePrefill }) => {
8 const { t } = useTranslation();
9 const Extand_Class = localStorage.getItem("Extand_Class");
10 const extClass = Extand_Class && JSON.parse(Extand_Class);
11 const isTemplateReport = reportName === "Templates";
12 const isCompletedReport = reportName === "Completed Documents";
13 const [isShowAllSigners, setIsShowAllSigners] = useState({});
14 const [isModal, setIsModal] = useState(false);
15 const shouldShowSigner = [
16 "In-progress documents",
17 "Need your sign",
18 "Completed Documents"
19 ].includes(reportName);
20 const shouldRender =
21 !item?.IsSignyourself && handleRemovePrefill(item?.Placeholders);
22
23 const handleCloseModal = () => {
24 setIsModal({});
25 };
26 const handleViewSigners = (item) => {
27 setIsModal({ ["view_" + item.objectId]: true });
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 }`}

Callers

nothing calls this directly

Calls 5

getSignerEmailFunction · 0.90
handleRemovePrefillFunction · 0.85
formatStatusRowFunction · 0.85
handleViewSignersFunction · 0.85
handleCloseModalFunction · 0.70

Tested by

no test coverage detected