FormCard 截图数量文案摊平嵌套三元

- 本地张数 / 整组沿用线上 / 还没有截图三态先算成 screenshotSummary
- 行为不变,去掉嵌套三元
This commit is contained in:
2026-10-07 11:01:04 +08:00
parent e4d46609cf
commit bb7097ce5c
@@ -59,6 +59,13 @@ export function FormCard({
const [screenshotImporterOpen, setScreenshotImporterOpen] = useState(false);
const screenshotsFull =
form.screenshotPaths.length >= MAX_AGC_GAME_SCREENSHOTS;
// 三态先摊平:有本地图 → 报张数;否则线上有可沿用的整组截图 → 沿用;否则还没截图。
let screenshotSummary = '还没有截图';
if (form.screenshotPaths.length > 0) {
screenshotSummary = `本地 ${form.screenshotPaths.length} 张`;
} else if (onlineScreenshotCount > 0) {
screenshotSummary = '整组沿用线上截图';
}
return (
<section
@@ -215,11 +222,7 @@ export function FormCard({
游戏截图
</span>
<span className="text-xs text-(--platform-text-soft)">
{form.screenshotPaths.length > 0
? `本地 ${form.screenshotPaths.length} 张`
: onlineScreenshotCount > 0
? '整组沿用线上截图'
: '还没有截图'}
{screenshotSummary}
</span>
</div>
{form.screenshotPaths.length > 0 ? (