import React from "react";
import classnames from "classnames";
import PropTypes from "prop-types";

interface INavbarBrandProps {
  href?: string;
  className?: string;
  as?: React.ElementType;
}

const NavbarBrand: React.FC<INavbarBrandProps> = ({ className, as, ...props }) => {
  const Component = as || (props.href ? "a" : "span");

  return <Component {...props} className={classnames("navbar-brand", className)} />;
};

NavbarBrand.displayName = "NavbarBrand";

NavbarBrand.propTypes = {
  href: PropTypes.string,
  className: PropTypes.string
};

export default NavbarBrand;
