fix: refactor wizard edit mode to use lazy state init instead of effect setState

This commit is contained in:
2026-04-28 09:51:26 +08:00
parent d8d0e8f826
commit d6a9601591
8 changed files with 868 additions and 97 deletions
+15
View File
@@ -33,6 +33,9 @@ import { FpsBoxplot } from "@/components/charts/FpsBoxplot"
import { FpsRangeChart } from "@/components/charts/FpsRangeChart"
import { DeviceDonut } from "@/components/charts/DeviceDonut"
// Comments
import { CommentSection } from "@/components/comments/comment-section"
// Types
interface Game {
id: string
@@ -1011,6 +1014,18 @@ export function GamePageClient({
</div>
</motion.div>
{/* Section 6: Comments */}
<motion.div
initial={{ opacity: 0, y: 12 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.4, delay: 0.3 }}
className='px-4 md:px-[10svw]'
>
<div className='max-w-7xl mx-auto'>
<CommentSection gameId={gameId} initialCount={counts.comments} />
</div>
</motion.div>
</section>
<AnimatePresence>
{selectedPresetId && (() => {