From 2ca10931dd321e364af290065f6607f2a03e7b8a Mon Sep 17 00:00:00 2001 From: "MSI\\User" Date: Wed, 10 Jan 2024 17:59:03 +0800 Subject: [PATCH] Dashboard tab button update --- .../DashboardPage/DashboardTabButton.tsx | 43 ++++++++++++++++++- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/src/components/DashboardPage/DashboardTabButton.tsx b/src/components/DashboardPage/DashboardTabButton.tsx index a07a2ba..25e2863 100644 --- a/src/components/DashboardPage/DashboardTabButton.tsx +++ b/src/components/DashboardPage/DashboardTabButton.tsx @@ -1,5 +1,6 @@ "use client"; import Grid from "@mui/material/Grid"; +import { useState } from 'react' import Paper from "@mui/material/Paper"; import { TFunction } from "i18next"; import { useTranslation } from "react-i18next"; @@ -7,12 +8,50 @@ import PageTitle from "../PageTitle/PageTitle"; import '../../app/global.css'; const DashboardTabButton: React.FC = () => { + const [activeTab, setActiveTab] = useState('financialSummary'); const { t } = useTranslation("dashboard"); + const renderContent = () => { + switch (activeTab) { + case 'financialSummary': + return
Project Financial Summary
; + case 'cashFlow': + return
Project Cash Flow
; + case 'projectProgress': + return
Project Progress by Client
; + case 'resourceUtilization': + return
Project Resource Utilization
; + case 'staffUtilization': + return
Staff Utilization
; + default: + return
Project Financial Summary
; + } + }; return (
- - + {activeTab !== 'financialSummary' ? + : + + } + {activeTab !== 'cashFlow' ? + : + + } + {activeTab !== 'progressByClient' ? + : + + } + {activeTab !== 'resourceUtilization' ? + : + + } + {activeTab !== 'staffUtilization' ? + : + + } +
+
+ {renderContent()}
);