showDocument(document.id)}
- >
- |
- {document.title || "#" + document.id}
- |
-
- {document.Recipient.map((item: any) => (
-
- {item.sendStatus === "NOT_SENT" ? (
+ {filterdDocuments.map((document: any, index: number) => (
+ showDocument(document.id)}
+ >
+ |
+ {document.title || "#" + document.id}
+ |
+
+ {document.Recipient.map((item: any) => (
+
+ {item.sendStatus === "NOT_SENT" ? (
+
+ {item.name
+ ? item.name + " <" + item.email + ">"
+ : item.email}
+
+ ) : (
+ ""
+ )}
+ {item.sendStatus === "SENT" &&
+ item.readStatus !== "OPENED" ? (
+
+
{item.name
? item.name + " <" + item.email + ">"
: item.email}
- ) : (
- ""
- )}
- {item.sendStatus === "SENT" &&
- item.readStatus !== "OPENED" ? (
-
-
-
- {item.name
- ? item.name + " <" + item.email + ">"
- : item.email}
-
+
+ ) : (
+ ""
+ )}
+ {item.readStatus === "OPENED" &&
+ item.signingStatus === "NOT_SIGNED" ? (
+
+
+
+
+ {item.name
+ ? item.name + " <" + item.email + ">"
+ : item.email}
- ) : (
- ""
- )}
- {item.readStatus === "OPENED" &&
- item.signingStatus === "NOT_SIGNED" ? (
-
-
-
-
- {item.name
- ? item.name + " <" + item.email + ">"
- : item.email}
-
+
+ ) : (
+ ""
+ )}
+ {item.signingStatus === "SIGNED" ? (
+
+
+ {" "}
+ {item.email}
- ) : (
- ""
- )}
- {item.signingStatus === "SIGNED" ? (
-
-
- {" "}
- {item.email}
-
-
- ) : (
- ""
- )}
-
- ))}
- {document.Recipient.length === 0 ? "-" : null}
-
-
-
- |
-
- {formatDocumentStatus(document.status)}
-
-
- {document.Recipient.filter(
- (r: any) => r.signingStatus === "SIGNED"
- ).length || 0}
- /{document.Recipient.length || 0}
-
-
- |
-
- {new Date(document.created).toLocaleDateString()}
- |
-
-
- {
- event.preventDefault();
- event.stopPropagation();
- router.push("/documents/" + document.id);
- }}
- >
- Edit
-
- {
- event.preventDefault();
- event.stopPropagation();
- router.push("/api/documents/" + document.id);
- }}
- >
- Download
-
- {
- event.preventDefault();
- event.stopPropagation();
- if (
- confirm(
- "Are you sure you want to delete this document"
- )
- ) {
- const documentsWithoutIndex = [
- ...documents,
- ];
- const removedItem: any =
- documentsWithoutIndex.splice(index, 1);
- setDocuments(documentsWithoutIndex);
- fetch(`/api/documents/${document.id}`, {
- method: "DELETE",
- })
- .catch((err) => {
- documentsWithoutIndex.splice(
- index,
- 0,
- removedItem
- );
- setDocuments(documentsWithoutIndex);
- })
- .then(() => {
- getDocuments();
- });
- }
- }}
- >
- , {document.name}
+
+ ) : (
+ ""
+ )}
- |
-
- )
- )}
+ ))}
+ {document.Recipient.length === 0 ? "-" : null}
+
+
+
+ |
+
+ {formatDocumentStatus(document.status)}
+
+
+ {document.Recipient.filter(
+ (r: any) => r.signingStatus === "SIGNED"
+ ).length || 0}
+ /{document.Recipient.length || 0}
+
+
+ |
+
+ {new Date(document.created).toLocaleDateString()}
+ |
+
+
+ {
+ event.preventDefault();
+ event.stopPropagation();
+ router.push("/documents/" + document.id);
+ }}
+ >
+ Edit
+
+ {
+ event.preventDefault();
+ event.stopPropagation();
+ router.push("/api/documents/" + document.id);
+ }}
+ >
+ Download
+
+ {
+ event.preventDefault();
+ event.stopPropagation();
+ if (
+ confirm(
+ "Are you sure you want to delete this document"
+ )
+ ) {
+ const documentsWithoutIndex = [...documents];
+ const removedItem: any =
+ documentsWithoutIndex.splice(index, 1);
+ setDocuments(documentsWithoutIndex);
+ fetch(`/api/documents/${document.id}`, {
+ method: "DELETE",
+ })
+ .catch((err) => {
+ documentsWithoutIndex.splice(
+ index,
+ 0,
+ removedItem
+ );
+ setDocuments(documentsWithoutIndex);
+ })
+ .then(() => {
+ getDocuments();
+ });
+ }
+ }}
+ >
+ , {document.name}
+
+ |
+
+ ))}