This commit is contained in:
2026-04-30 17:49:07 +08:00
parent 805d6f8cae
commit 9d684cb7b3
615 changed files with 15368 additions and 6172 deletions

View File

@@ -27,9 +27,11 @@ import {
export interface PlatformWorkDetailViewProps {
entry: PlatformPublicGalleryCard;
authorAvatarUrl?: string | null;
authorDisplayName?: string | null;
isBusy: boolean;
error: string | null;
onBack: () => void;
onLike: () => void;
onStart: () => void;
onRemix: () => void;
}
@@ -59,15 +61,19 @@ function getAuthorAvatarLabel(authorDisplayName: string) {
export function PlatformWorkDetailView({
entry,
authorAvatarUrl,
authorDisplayName,
isBusy,
error,
onBack,
onLike,
onStart,
onRemix,
}: PlatformWorkDetailViewProps) {
const coverImage = resolvePlatformWorldCoverImage(entry);
const publicWorkCode = resolvePlatformPublicWorkCode(entry);
const normalizedAuthorAvatarUrl = authorAvatarUrl?.trim() ?? '';
const resolvedAuthorDisplayName =
authorDisplayName?.trim() || entry.authorDisplayName;
const [copyState, setCopyState] = useState<'idle' | 'copied' | 'failed'>(
'idle',
);
@@ -85,13 +91,6 @@ export function PlatformWorkDetailView({
);
const stats = resolvePlatformWorldStats(entry);
const statItems = [
{
label: '改造',
value: formatCompactCount(stats.remixCount),
unit: '次',
icon: GitFork,
tone: 'remix',
},
{
label: '游玩',
value: formatCompactCount(stats.playCount),
@@ -99,6 +98,13 @@ export function PlatformWorkDetailView({
icon: Gamepad2,
tone: 'play',
},
{
label: '改造',
value: formatCompactCount(stats.remixCount),
unit: '次',
icon: GitFork,
tone: 'remix',
},
{
label: '点赞',
value: formatCompactCount(stats.likeCount),
@@ -107,7 +113,7 @@ export function PlatformWorkDetailView({
tone: 'like',
},
{
label: '最近更新',
label: '日期',
value: formatPlatformWorldTime(stats.updatedAt ?? stats.publishedAt),
icon: Clock3,
tone: 'time',
@@ -199,9 +205,7 @@ export function PlatformWorkDetailView({
)}
</div>
<div className="min-w-0 flex-1">
<div className="platform-work-detail__name">
{displayName}
</div>
<div className="platform-work-detail__name">{displayName}</div>
<div className="platform-work-detail__author">
<span className="platform-work-detail__author-avatar">
{normalizedAuthorAvatarUrl ? (
@@ -213,23 +217,25 @@ export function PlatformWorkDetailView({
/>
) : (
<span className="platform-work-detail__author-avatar-label">
{getAuthorAvatarLabel(entry.authorDisplayName)}
{getAuthorAvatarLabel(resolvedAuthorDisplayName)}
</span>
)}
</span>
<span className="platform-work-detail__author-name">
{entry.authorDisplayName}
{resolvedAuthorDisplayName}
</span>
</div>
</div>
<button
type="button"
className="platform-work-detail__remix"
onClick={onRemix}
className="platform-work-detail__like"
onClick={onLike}
disabled={isBusy}
aria-label={`点赞 ${formatCompactCount(stats.likeCount)}`}
title="点赞"
>
<GitFork className="h-5 w-5" />
<Heart className="h-5 w-5 fill-current" />
</button>
</div>
@@ -300,6 +306,15 @@ export function PlatformWorkDetailView({
</div>
<div className="platform-work-detail__bottom">
<button
type="button"
className="platform-work-detail__remix"
onClick={onRemix}
disabled={isBusy}
>
<GitFork className="h-5 w-5" />
</button>
<button
type="button"
className="platform-work-detail__start"