Add Button component to OtherUsersTR and update route path in main.tsx to include signedOrUnsigned parameter

This commit is contained in:
Davenludd 2024-04-09 10:15:19 +02:00
parent f61449dea1
commit b56e4ed76e

View file

@ -2,6 +2,7 @@ import { useState, useEffect } from "react";
import { WeeklyReport } from "../Types/goTypes";
import { api } from "../API/API";
import { useParams } from "react-router-dom";
import Button from "./Button";
/**
* Renders the component for editing a weekly report.
@ -22,6 +23,8 @@ export default function OtherUsersTR(): JSX.Element {
const { projectName } = useParams();
const { username } = useParams();
const { fetchedWeek } = useParams();
const { signedOrUnsigned } = useParams();
console.log(projectName, username, fetchedWeek, signedOrUnsigned);
useEffect(() => {
const fetchUsersWeeklyReport = async (): Promise<void> => {
@ -153,6 +156,15 @@ export default function OtherUsersTR(): JSX.Element {
</tr>
</tbody>
</table>
{signedOrUnsigned === "signed" && (
<Button
text="Unsign Report"
onClick={(): void => {
return;
}}
type="submit"
/>
)}
</div>
</div>
</>