import { computed } from 'vue'
import { useMain } from '@cip/hooks/use-main'
import { useCipConfig } from '@cip/components/hooks/use-cip-config'
import CipBreadcrumb from '@cip/components/main/cip-main-breadcrumb'
import './index.less'
export default {
  setup (props, { slots }) {
    const { closeTab } = useMain()
    const cipConfig = useCipConfig()
    const usingHideHeader = computed(() => {
      if (props.hideHeader !== undefined) {
        return props.hideHeader
      } else {
        return cipConfig.layout.hideHeader === true
      }
    })

    return () => <div class={'cip-info-theme-standard'}>
      {!usingHideHeader.value && <div class={'cip-info-theme-standard__breadcrumb'}>
        <CipBreadcrumb canBack={true} back={() => closeTab()} />
      </div>}
      <div class={'cip-info-theme-standard__info'}>
        {slots?.default()}
      </div>
    </div>
  }
}
