You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

62 lines
4.0 KiB

  1. "use client";
  2. import Grid from "@mui/material/Grid";
  3. import { useState } from 'react'
  4. import Paper from "@mui/material/Paper";
  5. import { TFunction } from "i18next";
  6. import { useTranslation } from "react-i18next";
  7. import PageTitle from "../PageTitle/PageTitle";
  8. import ProgressByClient from "./ProgressByClient";
  9. import '../../app/global.css';
  10. const DashboardTabButton: React.FC = () => {
  11. const [activeTab, setActiveTab] = useState('financialSummary');
  12. const { t } = useTranslation("dashboard");
  13. const renderContent = () => {
  14. switch (activeTab) {
  15. case 'financialSummary':
  16. return <div>Project Financial Summary</div>;
  17. case 'cashFlow':
  18. return <div>Project Cash Flow</div>;
  19. case 'progressByClient':
  20. return <ProgressByClient/>;
  21. case 'resourceUtilization':
  22. return <div>Project Resource Utilization</div>;
  23. case 'staffUtilization':
  24. return <div>Staff Utilization</div>;
  25. default:
  26. return <div>Project Financial Summary</div>;
  27. }
  28. };
  29. return (
  30. <Grid item sm>
  31. <div style={{marginLeft:20}}>
  32. {activeTab !== 'financialSummary' ?
  33. <button onClick={() => setActiveTab('financialSummary')}className="hover:bg-sky-100 hover:cursor-pointer rounded-lg bg-transparent border-cyan-500 border-solid text-cyan-500 ml-0.5 mt-0.5" style={{height:40,width:250,fontSize:18}}>Project Financial Summary</button> :
  34. <button onClick={() => setActiveTab('financialSummary')}className="rounded-lg bg-sky-100 border-cyan-500 border-solid text-cyan-500 ml-0.5 mt-0.5" style={{height:40,width:250,fontSize:18}}>Project Financial Summary</button>
  35. }
  36. {activeTab !== 'cashFlow' ?
  37. <button onClick={() => setActiveTab('cashFlow')} className="hover:bg-sky-100 hover:cursor-pointer rounded-lg bg-transparent border-cyan-500 border-solid text-cyan-500 ml-0.5 mt-0.5" style={{height:39,width:250,fontSize:18}}>Project Cash Flow</button> :
  38. <button onClick={() => setActiveTab('cashFlow')} className="rounded-lg bg-sky-100 border-cyan-500 border-solid text-cyan-500 ml-0.5 mt-0.5" style={{height:39,width:250,fontSize:18}}>Project Cash Flow</button>
  39. }
  40. {activeTab !== 'progressByClient' ?
  41. <button onClick={() => setActiveTab('progressByClient')} className="hover:bg-sky-100 hover:cursor-pointer rounded-lg bg-transparent border-cyan-500 border-solid text-cyan-500 ml-0.5 mt-0.5" style={{height:39,width:250,fontSize:18}}>Project Progress by Client</button> :
  42. <button onClick={() => setActiveTab('progressByClient')} className="rounded-lg bg-sky-100 border-cyan-500 border-solid text-cyan-500 ml-0.5 mt-0.5" style={{height:39,width:250,fontSize:18}}>Project Progress by Client</button>
  43. }
  44. {activeTab !== 'resourceUtilization' ?
  45. <button onClick={() => setActiveTab('resourceUtilization')} className="hover:bg-sky-100 hover:cursor-pointer rounded-lg bg-transparent border-cyan-500 border-solid text-cyan-500 ml-0.5 mt-0.5" style={{height:39,width:250,fontSize:18}}>Project Resource Utilization</button> :
  46. <button onClick={() => setActiveTab('resourceUtilization')} className="rounded-lg bg-sky-100 border-cyan-500 border-solid text-cyan-500 ml-0.5 mt-0.5" style={{height:39,width:250,fontSize:18}}>Project Resource Utilization</button>
  47. }
  48. {activeTab !== 'staffUtilization' ?
  49. <button onClick={() => setActiveTab('staffUtilization')} className="hover:bg-sky-100 hover:cursor-pointer rounded-lg bg-transparent border-cyan-500 border-solid text-cyan-500 ml-0.5 mt-0.5" style={{height:39,width:250,fontSize:18}}>Staff Utilization</button> :
  50. <button onClick={() => setActiveTab('staffUtilization')} className="rounded-lg bg-sky-100 border-cyan-500 border-solid text-cyan-500 ml-0.5 mt-0.5" style={{height:39,width:250,fontSize:18}}>Staff Utilization</button>
  51. }
  52. </div>
  53. <div style={{marginLeft:20,marginTop:20}}>
  54. {renderContent()}
  55. </div>
  56. </Grid>
  57. );
  58. };
  59. export default DashboardTabButton;