40234-vm/frontend/src/components/BookingLink.tsx
2026-06-11 16:39:28 +00:00

31 lines
542 B
TypeScript

import Link from 'next/link';
import React from 'react';
type BookingLinkProps = {
href: string;
children: React.ReactNode;
className?: string;
};
export default function BookingLink({
href,
children,
className,
}: BookingLinkProps) {
const isExternal = /^https?:\/\//.test(href);
if (isExternal) {
return (
<a href={href} className={className} target='_blank' rel='noreferrer'>
{children}
</a>
);
}
return (
<Link href={href} className={className}>
{children}
</Link>
);
}