Add total time in TimePerActivity component

This commit is contained in:
Davenludd 2024-04-14 15:52:13 +02:00
parent d1b6866c39
commit a25413affa

View file

@ -14,6 +14,7 @@ export default function TimePerRole(): JSX.Element {
const [own_work, setOwnWork] = useState<number>(0); const [own_work, setOwnWork] = useState<number>(0);
const [study, setStudy] = useState<number>(0); const [study, setStudy] = useState<number>(0);
const [testing, setTesting] = useState<number>(0); const [testing, setTesting] = useState<number>(0);
const total = development + meeting + admin + own_work + study + testing;
const token = localStorage.getItem("accessToken") ?? ""; const token = localStorage.getItem("accessToken") ?? "";
const { projectName } = useParams(); const { projectName } = useParams();
@ -49,7 +50,7 @@ export default function TimePerRole(): JSX.Element {
return ( return (
<> <>
<h1 className="font-bold text-[30px] mb-[20px]"> <h1 className="font-bold text-[30px] mb-[20px]">
Total Time Per Activity In: {projectName}{" "} Total Time Per Activity For All Members In: {projectName}{" "}
</h1> </h1>
<div className="border-4 border-black bg-white flex flex-col justify-start min-h-[65vh] h-fit w-[50vw] rounded-3xl overflow-scroll space-y-[2vh] p-[30px] items-center"> <div className="border-4 border-black bg-white flex flex-col justify-start min-h-[65vh] h-fit w-[50vw] rounded-3xl overflow-scroll space-y-[2vh] p-[30px] items-center">
<div className="flex flex-col items-center"> <div className="flex flex-col items-center">
@ -129,6 +130,12 @@ export default function TimePerRole(): JSX.Element {
/> />
</td> </td>
</tr> </tr>
<tr className="h-[10vh] font-bold font-">
<td>In Total:</td>
<td>
<h1>{total}</h1>
</td>
</tr>
</tbody> </tbody>
</table> </table>
</div> </div>