import React from 'react';
import cs from 'classnames';
import './style/index';
import { PREFIX_CLS } from '../../config';

const prefixCls = `${PREFIX_CLS}-a`;
export default ({ children, link = {}, style, className }) => {
  return link.href ? (
    <a
      target={link.target || '_blank'}
      className={cs(`${prefixCls}`, className)}
      href={link.href}
      style={style}
    >
      {children}
    </a>
  ) : (
    <>{children}</>
  );
};
