{"size": 596, "ext": "js", "max_stars_repo_path": "src/components/Button/index.js", "max_stars_repo_name": "zipquote/prakharshukla.xyz", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/components/Button/index.js", "max_issues_repo_name": "zipquote/prakharshukla.xyz", "max_issues_repo_issues_event_min_datetime": "2021-01-24T07:29:09.000Z", "max_issues_repo_issues_event_max_datetime": "2021-01-25T07:33:33.000Z", "max_forks_repo_path": "src/components/Button/index.js", "max_forks_repo_name": "zipquote/prakharshukla.xyz", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 2, "max_forks_count": null, "avg_line_length": 28.380952381, "max_line_length": 127, "alphanum_fraction": 0.6359060403}
import classNames from 'classnames';
import { NavLink } from '../';

export default function Button({ children, className, ...otherProps }) {
  const baseClass =
    'p-1 mx-1 mb-1 border-2 border-black dark:border-white bg-white dark:bg-black dark:text-white rounded shadow-btn relative';
  if (otherProps.href) {
    return (
      <NavLink className={classNames(baseClass, className)} {...otherProps}>
        {children}
      </NavLink>
    );
  } else {
    return (
      <button className={classNames(baseClass, className)} {...otherProps}>
        {children}
      </button>
    );
  }
}
