競賽資訊完整版 ( 只剩評分、競賽得獎 )
This commit is contained in:
@@ -70,16 +70,19 @@ const getAppDetails = (appId: string, team: any) => {
|
||||
type: appDetail.type || "未知類型",
|
||||
description: appDetail.description || "無描述",
|
||||
icon: getIconComponent(appDetail.icon) || Brain,
|
||||
iconColor: appDetail.icon_color || "from-blue-500 to-purple-500",
|
||||
fullDescription: appDetail.description || "無描述",
|
||||
features: [],
|
||||
author: appDetail.creator_name || "未知作者",
|
||||
department: appDetail.creator_department || "未知部門",
|
||||
category: appDetail.category || "未分類",
|
||||
tags: [],
|
||||
demoUrl: "",
|
||||
sourceUrl: "",
|
||||
likes: appDetail.likes_count || 0,
|
||||
views: appDetail.views_count || 0,
|
||||
rating: Number(appDetail.rating) || 0
|
||||
rating: Number(appDetail.rating) || 0,
|
||||
createdAt: appDetail.created_at
|
||||
};
|
||||
}
|
||||
|
||||
@@ -126,17 +129,22 @@ export function TeamDetailDialog({ open, onOpenChange, team }: TeamDetailDialogP
|
||||
const appDetails = getAppDetails(appId, team)
|
||||
// Create app object that matches AppDetailDialog interface
|
||||
const app = {
|
||||
id: Number.parseInt(appId),
|
||||
id: appId, // 保持為字符串,API 期望字符串 ID
|
||||
name: appDetails.name,
|
||||
type: appDetails.type,
|
||||
department: team.department, // Use team's department
|
||||
department: appDetails.department, // Use app's creator department
|
||||
description: appDetails.description,
|
||||
icon: appDetails.icon,
|
||||
iconColor: appDetails.iconColor, // Pass icon color
|
||||
creator: appDetails.author,
|
||||
featured: false,
|
||||
judgeScore: appDetails.rating || 0,
|
||||
likes: appDetails.likes || 0,
|
||||
views: appDetails.views || 0,
|
||||
// 使用 AppDetailDialog 期望的屬性名
|
||||
likesCount: appDetails.likes || 0,
|
||||
viewsCount: appDetails.views || 0,
|
||||
rating: appDetails.rating || 0,
|
||||
reviewsCount: 0, // 可以從 API 獲取,暫時設為 0
|
||||
createdAt: appDetails.createdAt, // Pass creation date
|
||||
}
|
||||
setSelectedApp(app)
|
||||
setAppDetailOpen(true)
|
||||
|
Reference in New Issue
Block a user