allaw-ui 1.0.84 → 1.0.86
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/molecules/caseCardCompact/caseCardCompact.css +1 -1
- package/dist/components/molecules/clientLinkCard/ClientLinkCard.css +1 -1
- package/dist/components/molecules/documentCard/DocumentCard.d.ts +2 -2
- package/dist/components/molecules/documentCard/DocumentCard.js +7 -1
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import "./DocumentCard.css";
|
|
3
3
|
export interface DocumentCardProps {
|
|
4
|
-
type: "document" | "note" | "invoice" | "waiting";
|
|
4
|
+
type: "document" | "note" | "invoice" | "waiting" | undefined;
|
|
5
5
|
title: string;
|
|
6
|
-
date: Date;
|
|
6
|
+
date: Date | undefined;
|
|
7
7
|
status: "sent" | "received" | "internal";
|
|
8
8
|
documents?: {
|
|
9
9
|
[key: string]: boolean;
|
|
@@ -4,7 +4,7 @@ import IconButton from "../../atoms/buttons/IconButton";
|
|
|
4
4
|
import OtherStatusTag from "../../atoms/tags/OtherStatusTag";
|
|
5
5
|
import { Paragraph } from "../../atoms/typography";
|
|
6
6
|
var DocumentCard = function (_a) {
|
|
7
|
-
var
|
|
7
|
+
var _b = _a.type, type = _b === void 0 ? "document" : _b, title = _a.title, _c = _a.date, date = _c === void 0 ? new Date() : _c, onCardClick = _a.onCardClick, status = _a.status, _d = _a.documents, documents = _d === void 0 ? {} : _d, _e = _a.documentCount, documentCount = _e === void 0 ? "" : _e;
|
|
8
8
|
var getIconName = function () {
|
|
9
9
|
switch (type) {
|
|
10
10
|
case "document":
|
|
@@ -32,12 +32,18 @@ var DocumentCard = function (_a) {
|
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
34
|
var getDisplayType = function (type) {
|
|
35
|
+
if (!type) {
|
|
36
|
+
return "";
|
|
37
|
+
}
|
|
35
38
|
if (type === "invoice") {
|
|
36
39
|
return "FACTURE";
|
|
37
40
|
}
|
|
38
41
|
return type.toUpperCase();
|
|
39
42
|
};
|
|
40
43
|
var formatDate = function (date) {
|
|
44
|
+
if (!date) {
|
|
45
|
+
return "";
|
|
46
|
+
}
|
|
41
47
|
return date.toLocaleDateString("fr-FR", {
|
|
42
48
|
day: "2-digit",
|
|
43
49
|
month: "2-digit",
|