TTime/frontend/src/Components/BackButton.tsx

25 lines
743 B
TypeScript
Raw Normal View History

2024-03-20 13:51:45 +01:00
//info: Back button component to navigate back to the previous page
import { useNavigate } from "react-router-dom";
2024-03-20 13:51:45 +01:00
/**
* Renders a back button component.
*
* @returns The JSX element representing the back button.
*/
function BackButton(): JSX.Element {
const navigate = useNavigate();
const goBack = (): void => {
navigate(-1);
};
return (
<button
onClick={goBack}
className="inline-block py-1 px-8 font-bold bg-orange-500 text-white border-2 border-black rounded-full cursor-pointer mt-5 mb-5 transition-colors duration-10 hover:bg-orange-600 hover:text-gray-300 font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; font-size: 4vh;"
>
Back
</button>
);
}
export default BackButton;