<template>
  <div class="d-flex align-center admin-icon-title">
    <div class="d-flex align-center admin-icon-title__text">
      <a-icon v-if="!readOnly" type="form" style="color: #1890ff; font-size: 16px" />
      <a-icon v-else type="tag" style="color: #1890ff; font-size: 16px" />
      <div class="admin-icon-title__title">
        <slot name="title" />
      </div>
    </div>
    <div class="option" v-if="!readOnly">
      <a-space size="small">
        <slot name="option" />
      </a-space>
    </div>
  </div>
</template>

<script>
export default {
  name: 'AdminIconTitle',
  props: {
    readOnly: {
      type: Boolean,
      default: false
    }
  }
}
</script>

<style lang="scss" scoped>
.admin-icon-title {
  margin: 0 0 8px 0;
  justify-content: space-between;
  background-color: #e6f7ff;
  min-height: 36px;
  border-radius: 4px;
  padding: 0 15px;
  border: 1px solid #91d5ff;
  &__text {
    padding: 10px 0;
    width: 50%;
  }
  &__title {
    color: #000000d9;
    font-size: 16px;
    margin-left: 6px;
  }
}
</style>
