<template>
  <centered-1280-box>
    <history-table :data="historyData" />
  </centered-1280-box>
</template>

<script lang="ts">
import { Component, Prop, Vue } from 'vue-property-decorator';

import Centered1280Box from '@/recruits/components/common/centered-1280-box.vue';
import HistoryTable from '@/recruits/components/common/history-table.vue';

import {
  SubpoenaOneResponseV3,
  History,
} from '@/recruits/openapi/subpoena-service';

@Component({
  components: {
    Centered1280Box,
    HistoryTable,
  },
})
export default class HistoryTab extends Vue {
  @Prop()
  readonly data: SubpoenaOneResponseV3;

  get historyData(): History[] | [] {
    if (Array.isArray(this.data.history)) {
      return this.data.history;
    }
    return [];
  }
}
</script>
