@pushwoosh/smart-components-kit 1.0.45 → 1.0.46

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.
@@ -14,6 +14,7 @@ type ExportCsvBannerProps = {
14
14
  showLastExportLocalStorageKey?: string;
15
15
  lastTasksParams?: GetLastTasksRequest;
16
16
  isKeepPageOpenWarning?: boolean;
17
+ onClose?: () => void;
17
18
  };
18
- export declare const ExportCsvBanner: ({ exportTask, updateExportTask, showLastExportLocalStorageKey, lastTasksParams, isKeepPageOpenWarning, }: ExportCsvBannerProps) => React.JSX.Element | null;
19
+ export declare const ExportCsvBanner: ({ exportTask, updateExportTask, showLastExportLocalStorageKey, lastTasksParams, isKeepPageOpenWarning, onClose, }: ExportCsvBannerProps) => React.JSX.Element | null;
19
20
  export {};
@@ -1,4 +1,4 @@
1
- import React, { useEffect } from 'react';
1
+ import React, { useCallback, useEffect } from 'react';
2
2
  import { ExportResult, ProgressBar, Button } from '@pushwoosh/dumb-components';
3
3
  import { Color, ShapeRadius } from '@pushwoosh/kit-constants';
4
4
  import { Horizontal } from '@pushwoosh/kit-helpers';
@@ -11,7 +11,8 @@ export const ExportCsvBanner = ({
11
11
  updateExportTask,
12
12
  showLastExportLocalStorageKey,
13
13
  lastTasksParams,
14
- isKeepPageOpenWarning
14
+ isKeepPageOpenWarning,
15
+ onClose
15
16
  }) => {
16
17
  const {
17
18
  getLastTasks,
@@ -78,6 +79,10 @@ export const ExportCsvBanner = ({
78
79
  });
79
80
  }
80
81
  }, [getLastTasks, isHidden, lastTasksParams, updateExportTask]);
82
+ const handleClose = useCallback(() => {
83
+ hide();
84
+ onClose === null || onClose === void 0 || onClose();
85
+ }, [hide, onClose]);
81
86
  if (!exportTask || isHidden) return null;
82
87
  const {
83
88
  filename,
@@ -95,7 +100,7 @@ export const ExportCsvBanner = ({
95
100
  type: "success",
96
101
  title: "Exporting complete",
97
102
  subtitle: `${resultSubTitle} ${filename}`,
98
- handleClose: hide,
103
+ handleClose: handleClose,
99
104
  rightSlot: React.createElement("a", {
100
105
  href: `/api/v2/statistics/exportMessagesStatistics/download/${filename}`,
101
106
  download: filename
@@ -126,6 +131,6 @@ export const ExportCsvBanner = ({
126
131
  size: "medium",
127
132
  view: "filled"
128
133
  }),
129
- handleClose: hide
134
+ handleClose: handleClose
130
135
  }));
131
136
  };
package/package.json CHANGED
@@ -49,5 +49,5 @@
49
49
  "engines": {
50
50
  "node": ">= 18"
51
51
  },
52
- "version": "1.0.45"
52
+ "version": "1.0.46"
53
53
  }