import { useEffect, useRef } from 'react' import { usePicked, useEnd, useProfile } from '@remake/hooks' import { useEndJudge } from '@/hooks/judge' import { properties, judgeDisplay } from '@/display' import TalentComponent from '@/components/Talent' import './Summary.css' function Judges() { const judges = useEndJudge() return ( ) } interface TalentListProps { picked: Set picker: (id: number) => void } function TalentList({ picked, picker }: TalentListProps) { const [profile] = useProfile() const talents = usePicked() const hasInitialized = useRef(false) useEffect(() => { if (!profile.locked) return if (!hasInitialized.current) { for (const id of profile.locked) { if (talents.has(id) && !picked.has(id)) { picker(id) } } hasInitialized.current = true } }, [profile.locked, talents, picked, picker]) return ( ) } export default function Summary() { const [locked, picker, end] = useEnd() const handleEnd = () => { const achievements = end() // TODO: Show achievements console.log('Achievements', achievements) } return (
你可以锁定一个天赋,下辈子还能抽到
) }