allaw-ui 1.0.85 → 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.
@@ -3,7 +3,7 @@ import "./DocumentCard.css";
3
3
  export interface DocumentCardProps {
4
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 _b = _a.type, type = _b === void 0 ? "document" : _b, title = _a.title, date = _a.date, onCardClick = _a.onCardClick, status = _a.status, _c = _a.documents, documents = _c === void 0 ? {} : _c, _d = _a.documentCount, documentCount = _d === void 0 ? "" : _d;
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":
@@ -41,6 +41,9 @@ var DocumentCard = function (_a) {
41
41
  return type.toUpperCase();
42
42
  };
43
43
  var formatDate = function (date) {
44
+ if (!date) {
45
+ return "";
46
+ }
44
47
  return date.toLocaleDateString("fr-FR", {
45
48
  day: "2-digit",
46
49
  month: "2-digit",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "allaw-ui",
3
- "version": "1.0.85",
3
+ "version": "1.0.86",
4
4
  "description": "Composants UI pour l'application Allaw",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",