headplane/app/components/Link.tsx

36 lines
639 B
TypeScript
Raw Normal View History

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';
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;
}
2025-02-04 17:21:03 -05:00
export default function Link({
to,
name: alt,
children,
className,
}: LinkProps) {
return (
<a
href={to}
aria-label={alt}
target="_blank"
rel="noreferrer"
className={cn(
2025-02-04 17:21:03 -05:00
'inline-flex items-center gap-x-0.5',
'text-blue-500 hover:text-blue-700',
'dark:text-blue-400 dark:hover:text-blue-300',
'focus:outline-none focus:ring rounded-md',
className,
)}
>
{children}
2025-02-04 17:21:03 -05:00
<ExternalLink className="w-3.5" />
</a>
2024-12-31 10:30:14 +05:30
);
}