@centreon/ui 23.10.30 → 23.10.31
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/package.json
CHANGED
|
@@ -10,6 +10,7 @@ import { Button } from '../../Button';
|
|
|
10
10
|
import { useStyles } from './DataTableEmptyState.styles';
|
|
11
11
|
|
|
12
12
|
type ListEmptyStateProps = {
|
|
13
|
+
canCreate?: boolean;
|
|
13
14
|
labels: {
|
|
14
15
|
actions: {
|
|
15
16
|
create: string;
|
|
@@ -21,7 +22,8 @@ type ListEmptyStateProps = {
|
|
|
21
22
|
|
|
22
23
|
const DataTableEmptyState = ({
|
|
23
24
|
labels,
|
|
24
|
-
onCreate
|
|
25
|
+
onCreate,
|
|
26
|
+
canCreate = true
|
|
25
27
|
}: ListEmptyStateProps): ReactElement => {
|
|
26
28
|
const { classes } = useStyles();
|
|
27
29
|
const { t } = useTranslation();
|
|
@@ -30,14 +32,16 @@ const DataTableEmptyState = ({
|
|
|
30
32
|
<div className={classes.dataTableEmptyState}>
|
|
31
33
|
<MuiTypography variant="h2">{t(labels.title)}</MuiTypography>
|
|
32
34
|
<div className={classes.actions}>
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
{canCreate && (
|
|
36
|
+
<Button
|
|
37
|
+
aria-label="create"
|
|
38
|
+
icon={<AddIcon />}
|
|
39
|
+
iconVariant="start"
|
|
40
|
+
onClick={() => onCreate?.()}
|
|
41
|
+
>
|
|
42
|
+
{t(labels.actions.create)}
|
|
43
|
+
</Button>
|
|
44
|
+
)}
|
|
41
45
|
</div>
|
|
42
46
|
</div>
|
|
43
47
|
);
|