2025-02-04 17:21:03 -05:00
|
|
|
import { ExternalLink } from 'lucide-react';
|
2025-01-28 17:46:16 -05:00
|
|
|
import cn from '~/utils/cn';
|
2024-05-04 15:04:55 -04:00
|
|
|
|
2025-02-04 17:21:03 -05:00
|
|
|
export interface LinkProps {
|
2024-12-31 10:30:14 +05:30
|
|
|
to: string;
|
|
|
|
|
name: string;
|
|
|
|
|
children: string;
|
|
|
|
|
className?: string;
|
2024-05-04 15:04:55 -04:00
|
|
|
}
|
|
|
|
|
|
2025-02-04 17:21:03 -05:00
|
|
|
export default function Link({
|
|
|
|
|
to,
|
|
|
|
|
name: alt,
|
|
|
|
|
children,
|
|
|
|
|
className,
|
|
|
|
|
}: LinkProps) {
|
2024-05-04 15:04:55 -04:00
|
|
|
return (
|
|
|
|
|
<a
|
|
|
|
|
href={to}
|
|
|
|
|
aria-label={alt}
|
2024-05-26 19:23:24 -04:00
|
|
|
target="_blank"
|
|
|
|
|
rel="noreferrer"
|
2024-05-04 15:04:55 -04:00
|
|
|
className={cn(
|
2025-02-04 17:21:03 -05:00
|
|
|
'inline-flex items-center gap-x-0.5',
|
2024-05-04 15:04:55 -04:00
|
|
|
'text-blue-500 hover:text-blue-700',
|
|
|
|
|
'dark:text-blue-400 dark:hover:text-blue-300',
|
2025-05-29 09:45:47 -04:00
|
|
|
'focus:outline-hidden focus:ring-3 rounded-md',
|
2024-05-26 19:23:24 -04:00
|
|
|
className,
|
2024-05-04 15:04:55 -04:00
|
|
|
)}
|
|
|
|
|
>
|
|
|
|
|
{children}
|
2025-02-04 17:21:03 -05:00
|
|
|
<ExternalLink className="w-3.5" />
|
2024-05-04 15:04:55 -04:00
|
|
|
</a>
|
2024-12-31 10:30:14 +05:30
|
|
|
);
|
2024-05-04 15:04:55 -04:00
|
|
|
}
|