<template>
  <div class="dof-board">
    <div class="dof-board-header" v-if="title || subtitle">
      <text v-if="title" class="dof-board-header-title">{{ title }}</text>
      <text v-if="subtitle" class="dof-board-header-subtitle">{{ subtitle }}</text>
    </div>
    <slot name="header"></slot>
    <div :style="_boardBodyStyle">
      <slot></slot>
    </div>
  </div>
</template>

<script>
import ColmoMixin from '../../mixins/colmo'
import DiabloMixin from '../../mixins/diablo'
import { STYLE_MAP } from './style'
export default {
  mixins: [ColmoMixin, DiabloMixin],
  props: {
    title: {
      type: String,
      default: ''
    },
    subtitle: {
      type: String,
      default: ''
    },
    boardBodyStyle: {
      type: Object,
      default: () => ({})
    },
    dofBoardWrapperStyle: {
      type: Object,
      default: () => ({})
    }
  },
  computed: {
    themeStyle() {
      const _theme = this._theme || (this._isDiablo ? 'diablo' : 'default')
      return STYLE_MAP[_theme] || STYLE_MAP['default']
    },
    _boardBodyStyle() {
      let tmp = { backgroundColor: this.themeStyle.backgroundColor }
      let style = {
        paddingLeft: '31px',
        paddingRight: '31px',
        paddingTop: '32px',
        paddingBottom: '32px',
        ...tmp,
        ...this.boardBodyStyle
      }
      return style
    }
  }
}
</script>
<style src="./colmo.css" scoped></style>
<style scoped>
.dof-board {
  position: relative;
}

.dof-board-header {
  padding-left: 32px;
  padding-right: 32px;
  padding-top: 32px;
  padding-bottom: 32px;
  background-color: #f6f7f9;
}

.dof-board-header-title {
  font-family: PingFangSC-Medium;
  font-size: 36px;
  color: #1e2e37;
  font-weight: 500;
}

.dof-board-header-subtitle {
  margin-top: 16px;
  font-family: PingFangSC-Regular;
  font-size: 26px;
  color: #616c73;
  font-weight: 400;
}

/* .dof-board-body {
  padding-left: 32px;
  padding-right: 32px;
  padding-top: 32px;
  padding-bottom: 32px;
  background-color: #f9f9f9;
} */
</style>
<style src="./diablo.css" scoped></style>
