This repository has been archived on 2025-03-08. You can view files and clone it, but cannot push or open issues or pull requests.
aidxnCC/app/components/objects/BackButton.tsx

24 lines
810 B
TypeScript
Raw Normal View History

2025-01-08 09:14:02 -05:00
import React from 'react';
import Link from 'next/link';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faArrowLeft } from '@fortawesome/free-solid-svg-icons';
2025-01-08 09:33:27 -05:00
interface BackButtonProps {
href: string;
label?: string;
}
const BackButton: React.FC<BackButtonProps> = ({ href, label = 'Back' }) => {
2025-01-08 09:14:02 -05:00
return (
2025-01-08 09:33:27 -05:00
<Link
href={href}
className="inline-flex items-center px-4 py-2 mt-4 text-white bg-gray-800 rounded shadow-md transition-all duration-300 ease-in-out hover:bg-gray-700 hover:shadow-lg hover:-translate-y-0.5 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500"
aria-label={`Go back to ${label}`}
>
<FontAwesomeIcon icon={faArrowLeft} className="mr-2" />
{label}
2025-01-08 09:14:02 -05:00
</Link>
);
};
export default BackButton;