<template>
  <div class="ps-page-header">
    <div class="ps-page-header__left" @click="handleClick">
      <i class="ps-icon-back"></i>
      <div class="ps-page-header__title">
        <slot name="title">{{ title }}</slot>
      </div>
    </div>
    <div class="ps-page-header__content">
      <slot name="content">{{ content }}</slot>
    </div>
  </div>
</template>
<script lang='ts'>
import { defineComponent } from 'vue'
import { t } from '@present-ui/locale'

export default defineComponent({
  name: 'PsPageHeader',
  props: {
    title: {
      type: String,
      default: () => t('ps.pageHeader.title'),
    },
    content: {
      type: String,
      default: '',
    },
  },
  emits: ['back'],
  setup(props, { emit }) {

    function handleClick() {
      emit('back')
    }

    return {
      handleClick,
    }
  },
})
</script>
