<script setup lang="ts">

const props = defineProps<{
  srcData: any;
}>();
</script>

<template>
  <el-table :data="props.srcData.data">
    <el-table-column min-width="20%" :label="$t('TPCM_SECURE_BOOT')">
      <template #default="scope">
        <span :id="`${scope.row.name}-name`">{{ scope.row.name }}</span>
      </template>
    </el-table-column>
    <el-table-column min-width="20%" :label="$t('TPCM_VERSION')">
      <template #default="scope">
        <span :id="`${scope.row.name}-version`">{{ scope.row.version }}</span>
      </template>
    </el-table-column>
    <el-table-column min-width="48%" :label="$t('TPCM_SECURE_BOOT_DIGEST')">
      <template #default="scope">
        <span :id="`${scope.row.name}-signature`">{{ scope.row.signature }}</span>
      </template>
    </el-table-column>
    <el-table-column min-width="12%" :label="$t('TPCM_SECURE_BOOT_VERIFY')">
      <template #default="scope">
        <el-tag
          :type="scope.row.verificationResult === 0 ? 'success' : 'danger'"
        >
          <span :id="`${scope.row.name}-result`">{{ $t(scope.row.verificationResult === 0 ?
          'TPCM_SECURE_BOOT_VERIFY_PASS' :
          'TPCM_SECURE_BOOT_VERIFY_FAIL')
        }}</span>
        </el-tag>
      </template>
    </el-table-column>
  </el-table>
</template>

<style scoped lang="scss">
:deep(.el-tag) {
  min-width: 40px !important;
}
</style>