修正得獎資訊團體賽的名稱

This commit is contained in:
2025-09-27 17:43:01 +08:00
parent 88c3fde372
commit 4a3a0052f0
5 changed files with 134 additions and 48 deletions

View File

@@ -4046,12 +4046,12 @@ export function CompetitionManagement() {
const paginatedAwards = filteredAwards.slice(startIndex, endIndex)
return (
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 min-h-[400px]" style={{ gridAutoRows: 'max-content' }}>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 min-h-[400px]">
{paginatedAwards.map((award: any) => (
<Card key={award.id} className="relative overflow-hidden hover:shadow-lg transition-shadow">
<Card key={award.id} className="relative overflow-hidden hover:shadow-lg transition-shadow h-[280px] flex flex-col">
<div className="absolute top-4 right-4 text-2xl">{award.icon}</div>
<CardContent className="p-4">
<div className="space-y-3">
<CardContent className="p-4 flex-grow flex flex-col justify-between">
<div className="space-y-3 flex-grow">
{/* 獎項基本資訊 */}
<div className="space-y-2">
<Badge
@@ -4074,8 +4074,22 @@ export function CompetitionManagement() {
>
{award.award_name}
</Badge>
<h4 className="font-semibold text-lg pr-8">
{award.team_name || award.app_name || "作品"}
<h4 className="font-semibold text-lg pr-8 min-h-[2.5rem] line-clamp-2">
{(() => {
// 團體賽優先顯示團隊名稱
if (award.competition_type === "team") {
const teamName = award.team_name_from_teams || award.team_name;
return teamName || "團隊名稱";
}
// 提案賽顯示提案標題
if (award.competition_type === "proposal") {
return award.proposal_title || "提案標題";
}
// 個人賽顯示應用名稱
return award.app_name || "應用名稱";
})()}
</h4>
<p className="text-sm text-gray-600">by {award.creator}</p>
@@ -8811,7 +8825,21 @@ export function CompetitionManagement() {
<div>
<h3 className="text-xl font-bold text-gray-900">{selectedAward.awardName}</h3>
<p className="text-gray-600 mt-1">
{(selectedAward as any).app_name || (selectedAward as any).team_name || "團隊作品"} by {selectedAward.creator}
{(() => {
// 團體賽優先顯示團隊名稱
if (selectedAward.competitionType === "team") {
const teamName = (selectedAward as any).team_name_from_teams || (selectedAward as any).team_name;
return teamName || "團隊名稱";
}
// 提案賽顯示提案標題
if (selectedAward.competitionType === "proposal") {
return (selectedAward as any).proposal_title || "提案標題";
}
// 個人賽顯示應用名稱
return (selectedAward as any).app_name || "應用名稱";
})()} by {selectedAward.creator}
</p>
</div>
<div className="flex items-center space-x-3">