import React from "react";
import Link from "next/link";

/** Link component that can be disabled */
export const AsyncLink: React.FC<{ href: string; children: React.ReactNode, target?: string, className?: string, disabled?: boolean }> = ({ href, children, target, className, disabled }) =>
    disabled ? <span className={className}>{children}</span> :
        <Link
            href={href}
            target={target}
            className={className}
        >
            {children}
        </Link>
