<!-- SPEC: PJ2026-010405 云端控制台 / Projects. -->
<!-- Implementation reference: draft-2026-07-13-p0-cloud-console. -->
<!-- Responsibility: 提供链接拥有交互语义的项目实体卡片。 -->

<script setup lang="ts">
import { FolderKanban } from "lucide-vue-next";
import { RouterLink, type RouteLocationRaw } from "vue-router";
import EntityCard from "@/components/common/EntityCard.vue";
import type { ProjectRecord, ProjectSource } from "@/api";

defineProps<{ project: ProjectRecord; sources: ProjectSource[]; selected: boolean; to: RouteLocationRaw }>();
</script>

<template>
  <RouterLink class="industrial-card-link" :data-project-id="project.projectId" :to="to">
    <EntityCard
      :icon="FolderKanban"
      :title="project.name || project.title || project.projectId"
      :subtitle="project.projectId"
      :status="project.status || 'unknown'"
      :status-label="project.status || 'unknown'"
      :selected="selected"
      :interactive="false"
    >
      <div class="project-source-chips" aria-label="项目 source">
        <span
          v-for="source in sources"
          :key="source.sourceId"
          class="source-chip"
          :data-status="source.status || 'unknown'"
        >{{ source.displayName || source.sourceId }} · {{ source.status || 'unknown' }}</span>
        <span v-if="!sources.length" class="source-chip muted">无可见 source</span>
      </div>
      <template #footer><span>查看详情</span><span aria-hidden="true">→</span></template>
    </EntityCard>
  </RouterLink>
</template>
