<script setup lang="ts">
import type { ExperimentRecord } from '../types'
interface Props {
  experiment_id?: string
}
const props = defineProps<Props>()

const detail = $ref<ExperimentRecord>(inject('detail'))
const isEmpty = $computed(() => {
  return !props.experiment_id || !detail
})
</script>

<template>
  <el-empty description="暂无数据" v-if="isEmpty" />
  <template v-else>
    <h2>我的成绩</h2>
    <h2>实验过程</h2>
    <ul class="picture-list">
      <li v-for="item in detail.pictures" :key="item.url">
        <img :src="item.url" />
        <p>截图时间：{{ item.upload_time }}</p>
      </li>
    </ul>
  </template>
</template>

<style lang="scss" scoped>
.picture-list {
  li {
    position: relative;
    height: 200px;
    margin: 20px 0;
    img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
    p {
      position: absolute;
      left: 0;
      right: 0;
      bottom: 0;
      padding: 0 10px;
      font-size: 14px;
      color: #fff;
      line-height: 30px;
      text-align: right;
      background-color: rgba(0, 0, 0, 0.5);
    }
  }
}
</style>
