import { CSSProperties, ReactNode } from "react";
import { Tooltip } from "antd";
interface AProps {
href: string;
children: ReactNode;
title?: string;
placement?: string;
style?: CSSProperties;
onClick?: (any) => void;
onMouseDown?: (any) => void;
}
export function A({
href,
children,
style,
title,
placement,
onClick,
onMouseDown,
}: AProps) {
if (title) {
return (
<Tooltip title={title} placement={placement as any}>
<a
href={href}
target={"_blank"}
rel={"noopener"}
style={style}
onClick={onClick}
onMouseDown={onMouseDown}
>
{children}
</a>
</Tooltip>
);
}
return (
<a
href={href}
target={"_blank"}
rel={"noopener"}
style={style}
title={title}
onClick={onClick}
onMouseDown={onMouseDown}
>
{children}
</a>
);
}