import { isVNode as _isVNode } from "vue";
import { createVNode as _createVNode } from "vue";
import { getRenderComponent, PropTypes, withInstall } from '../utils';
import { computed, unref } from 'vue';

function _isSlot(s) {
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !_isVNode(s);
}

var LogoTitle = function LogoTitle(props, _ref) {
  var slots = _ref.slots;
  var logo = props.logo,
      title = props.title;
  var defLogo = getRenderComponent('logo', props, slots, '', {
    propsArgs: [props],
    slotArg: props
  });
  var logoDom = computed(function () {
    return typeof logo === 'string' ? _createVNode("img", {
      "src": logo,
      "alt": "Logo"
    }, null) : defLogo;
  });
  var showTitle = computed(function () {
    if (props.layout === 'side' && props.collapsed) {
      return false;
    }

    return true;
  });
  return _createVNode("div", {
    "class": 'logo-container'
  }, [_createVNode("div", {
    "class": 'logo'
  }, [unref(logoDom)]), unref(showTitle) && _createVNode("div", {
    "class": 'title'
  }, _isSlot(title) ? title : {
    default: function _default() {
      return [title];
    }
  })]);
};

LogoTitle.displayName = 'LogoTitle';
LogoTitle.inheritAttrs = false;
LogoTitle.props = {
  layout: PropTypes.string,
  collapsed: PropTypes.bool.def(false),
  logo: {
    type: [String, Boolean, Function, Object],
    default: ''
  },
  title: {
    type: [String, Boolean],
    default: 'Antd Pro Layout'
  }
};
export { LogoTitle };
export default withInstall(LogoTitle);