<template>
  <el-result icon="warning" :title="title" :sub-title="subTitle">
    <template #extra>
      <el-button type="primary" @click="onBack">
        {{ backText || $t('back') }}
      </el-button>
    </template>
  </el-result>
</template>

<script setup lang="ts">
  defineProps({
    title: {
      type: String,
      required: true,
    },
    subTitle: {
      type: String,
      required: false,
      default: '',
    },
    backText: {
      type: String,
      required: false,
      default: '',
    },
    onBack: {
      type: Function as () => unknown,
      required: false,
      default: undefined,
    },
  });
</script>
