forked from primeroIMS/primero
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontainer.jsx
41 lines (33 loc) · 1.23 KB
/
container.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.
import { SwapVert } from "@mui/icons-material";
import { useI18n } from "../../../i18n";
import { PageHeading, PageContent } from "../../../page";
import { useDialog } from "../../../action-dialog";
import { FormAction } from "../../../form";
import UsageReport from "./export/component";
import { USAGE_REPORT_DIALOG } from "./export/constants";
function Container() {
const i18n = useI18n();
const { setDialog, pending, dialogOpen, setDialogPending, dialogClose } = useDialog(USAGE_REPORT_DIALOG);
const handleExport = dialog => setDialog({ dialog, open: true });
const handleClickExport = () => handleExport(USAGE_REPORT_DIALOG);
return (
<>
<PageHeading title={i18n.t("settings.navigation.usage_reports")}>
<FormAction actionHandler={handleClickExport} text={i18n.t("buttons.export")} startIcon={<SwapVert />} />
</PageHeading>
<PageContent>
<UsageReport
i18n={i18n}
open={dialogOpen}
pending={pending}
close={dialogClose}
setPending={setDialogPending}
/>
</PageContent>
</>
);
}
Container.displayName = "UsageReports";
Container.propTypes = {};
export default Container;