<template>
  <div class="title">
    <div style="display: flex; align-items: center;">
      <div class="line" />
      <div class="text">{{ title }}</div>
      <slot
        name="icon"
        class=""
      />
    </div>

    <div class="controlBtn">
      <slot />
    </div>
  </div>
</template>

<script>
export default {
  name: 'PageHeader',
  props: {
    title: {
      type: String,
      default: 'title',
    },
  },
};
</script>

<style scoped lang="scss">
.title {
  width: 100%;
  height: 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;

  .line {
    width: 3px;
    height: 14px;
    background-color: #3389FF;
    border-radius: 1px;
    margin-top: 5px;
  }

  .text {
    height: 24px;
    line-height: 24px;
    margin-top: 5px;
    font-weight: 800;
    font-size: 14px;
    margin-left: 8px;
  }

  .controlBtn {
    height: 100%;
    display: flex;
    justify-content: flex-end;
    margin-top: auto;
    margin-bottom: auto;
    align-items: center;
    position: absolute;
    right: 0px;
  }

  .refresh-icon {
    margin-top: 5px;
    margin-left: 4px;
    cursor: pointer;
  }
}
</style>
