diff --git a/src/app/(main)/analytics/ProjectCashFlowReport/page.tsx b/src/app/(main)/analytics/ProjectCashFlowReport/page.tsx index 301ef12..7ba5f7e 100644 --- a/src/app/(main)/analytics/ProjectCashFlowReport/page.tsx +++ b/src/app/(main)/analytics/ProjectCashFlowReport/page.tsx @@ -1,18 +1,23 @@ import { Metadata } from "next"; import { Suspense } from "react"; -import { I18nProvider } from "@/i18n"; +import { I18nProvider, getServerI18n } from "@/i18n"; import { fetchProjects } from "@/app/api/projects"; import GenerateProjectCashFlowReport from "@/components/GenerateProjectCashFlowReport"; +import { Typography } from "@mui/material"; export const metadata: Metadata = { title: "Project Cash Flow Report", }; const ProjectCashFlowReport: React.FC = async () => { + const { t } = await getServerI18n("reports"); fetchProjects(); return ( <> + + {t("Project Cash Flow Report")} + }> diff --git a/src/components/GenerateProjectCashFlowReport/GenerateProjectCashFlowReport.tsx b/src/components/GenerateProjectCashFlowReport/GenerateProjectCashFlowReport.tsx index 0b7d661..e23888f 100644 --- a/src/components/GenerateProjectCashFlowReport/GenerateProjectCashFlowReport.tsx +++ b/src/components/GenerateProjectCashFlowReport/GenerateProjectCashFlowReport.tsx @@ -41,6 +41,7 @@ const GenerateProjectCashFlowReport: React.FC = ({ projects }) => { } } }} + formType={"download"} /> ); diff --git a/src/components/SearchBox/SearchBox.tsx b/src/components/SearchBox/SearchBox.tsx index 92eb204..716d495 100644 --- a/src/components/SearchBox/SearchBox.tsx +++ b/src/components/SearchBox/SearchBox.tsx @@ -15,6 +15,7 @@ import CardActions from "@mui/material/CardActions"; import Button from "@mui/material/Button"; import RestartAlt from "@mui/icons-material/RestartAlt"; import Search from "@mui/icons-material/Search"; +import FileDownload from '@mui/icons-material/FileDownload'; import dayjs from "dayjs"; import "dayjs/locale/zh-hk"; import { DatePicker } from "@mui/x-date-pickers/DatePicker"; @@ -58,12 +59,14 @@ interface Props { criteria: Criterion[]; onSearch: (inputs: Record) => void; onReset?: () => void; + formType?: String, } function SearchBox({ criteria, onSearch, onReset, + formType, }: Props) { const { t } = useTranslation("common"); const defaultInputs = useMemo( @@ -223,22 +226,22 @@ function SearchBox({ ); })} - - - - + + + + ); diff --git a/src/i18n/en/common.json b/src/i18n/en/common.json index a7d019a..57932c1 100644 --- a/src/i18n/en/common.json +++ b/src/i18n/en/common.json @@ -19,6 +19,7 @@ "Details": "Details", "Delete": "Delete", + "Download": "Download", "Search": "Search", "Search Criteria": "Search Criteria", "Cancel": "Cancel", diff --git a/src/i18n/zh/common.json b/src/i18n/zh/common.json index 4ff2fcf..ffcec1d 100644 --- a/src/i18n/zh/common.json +++ b/src/i18n/zh/common.json @@ -17,6 +17,7 @@ "Details": "詳情", "Delete": "刪除", + "Download": "下載", "Search": "搜尋", "Search Criteria": "搜尋條件", "Cancel": "取消",