<script  lang="js">

// export type StepStatus = 'finish' | 'process' | 'error' | 'wait' | 'reject';

const iconMap = {
  finish: 'el-icon-success',
  process: 'glp-step__success el-icon-more',
  error: 'el-icon-error',
  reject: 'el-icon-warning'
}

export default {
  name: 'glp-step',
  functional: true,
  render (h, context) {
    const status = context?.props?.status
    const icon = status ? iconMap[status] : undefined
    const title = context?.props?.title

    const data = {
      props: { icon, title },
      class: ['glp-step', `glp-step--${status}`]
    }
    return h('el-step', data, [h('div', { slot: 'description' }, [context.scopedSlots.default && context.scopedSlots.default()])])
  }
}
</script>
