import GlIcon from '../../../../../base/icon/icon';
import GlCollapse from '../../../../../base/collapse/collapse';
import GlButton from '../../../../../base/button/button';
import { GlTooltipDirective } from '../../../../../../directives/tooltip';
import { translate } from '../../../../../../utils/i18n';
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';

var script = {
  name: 'GlDuoWorkflowPanel',
  components: {
    GlCollapse,
    GlButton,
    GlIcon
  },
  directives: {
    GlTooltip: GlTooltipDirective
  },
  props: {
    /**
     * The icon to show in the header.
     */
    headerIcon: {
      type: String,
      required: false,
      default: ''
    },
    /**
     * The text used as the title and aria-label for the button when the collapse is collapsed
     */
    expandPanelButtonTitle: {
      type: String,
      required: false,
      default: translate('GlDuoWorkflowPanel.expandButtonTitle', 'Expand')
    },
    /**
     * The text used as the title and aria-label for the button when the collapse is expanded
     */
    collapsePanelButtonTitle: {
      type: String,
      required: false,
      default: translate('GlDuoWorkflowPanel.collapseButtonTitle', 'Collapse')
    },
    /**
     * Whether the panel is expanded or not
     */
    expanded: {
      type: Boolean,
      required: false,
      default: true
    }
  },
  computed: {
    buttonIcon() {
      return this.expanded ? 'chevron-up' : 'chevron-down';
    },
    buttonTitle() {
      return this.expanded ? this.collapsePanelButtonTitle : this.expandPanelButtonTitle;
    }
  }
};

/* script */
const __vue_script__ = script;

/* template */
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('div',{staticClass:"gl-flex gl-flex-nowrap gl-items-center"},[(_vm.headerIcon)?_c('gl-icon',{staticClass:"gl-mr-3",attrs:{"name":_vm.headerIcon,"size":24}}):_vm._e(),_vm._v(" "),_c('div',{staticClass:"gl-flex gl-flex-grow gl-items-baseline"},[_c('h2',{staticClass:"gl-mb-0"},[_vm._t("title")],2),_vm._v(" "),_c('small',{staticClass:"gl-ml-3"},[_vm._t("subtitle")],2)]),_vm._v(" "),_c('gl-button',{directives:[{name:"gl-tooltip",rawName:"v-gl-tooltip"}],attrs:{"category":"tertiary","icon":_vm.buttonIcon,"title":_vm.buttonTitle,"aria-label":_vm.buttonTitle},on:{"click":function($event){return _vm.$emit('toggle-panel')}}})],1),_vm._v(" "),_c('gl-collapse',{attrs:{"visible":_vm.expanded}},[_c('div',{staticClass:"gl-ml-7 gl-mt-4 gl-flex-grow"},[_vm._t("content")],2)])],1)};
var __vue_staticRenderFns__ = [];

  /* style */
  const __vue_inject_styles__ = undefined;
  /* scoped */
  const __vue_scope_id__ = undefined;
  /* module identifier */
  const __vue_module_identifier__ = undefined;
  /* functional template */
  const __vue_is_functional_template__ = false;
  /* style inject */
  
  /* style inject SSR */
  
  /* style inject shadow dom */
  

  
  const __vue_component__ = __vue_normalize__(
    { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
    __vue_inject_styles__,
    __vue_script__,
    __vue_scope_id__,
    __vue_is_functional_template__,
    __vue_module_identifier__,
    false,
    undefined,
    undefined,
    undefined
  );

export default __vue_component__;
