<template>
  <view class="module-container">
    <CommonSection title="项目文档" isFirst>
      <CommonFileList :files="fileList" />
    </CommonSection>
  </view>
</template>

<script setup lang="ts">
import { computed } from 'vue';
import type { ProjectFile } from '@/types/project';
import CommonFileList from '@/components/ui/CommonFileList.vue';
import CommonSection from '@/components/ui/CommonSection.vue';

/**
 * 接收父组件传递的属性
 */
const props = defineProps<{
  projectId: number;
  projectType: string;
  projectData: any;
}>();

/**
 * 计算属性：获取最终渲染的文件列表
 * 针对不同项目类型（纵向/横向/自发类）提取对应的文件列表字段
 */
const fileList = computed<ProjectFile[]>(() => {
  return props.projectData?.fileList || 
         props.projectData?.files || 
         [];
});
</script>

<style lang="scss" scoped>
.module-container {
  min-height: 400rpx;
  position: relative;
}
</style>
