update: rename component

This commit is contained in:
Vick Scarlet
2026-08-16 00:54:40 +08:00
parent bc2d89fa52
commit 0e8bf1131a
9 changed files with 22 additions and 22 deletions
+48
View File
@@ -0,0 +1,48 @@
import { useTalentPuller, useTalentPicker } from '@remake/hooks'
import { useTalentSubmit, useSubmitIsEnable } from '@remake/hooks'
import { PullCount, dev } from '@/config'
import Talent from '@/components/Talent'
import './Pick.css'
export function Pick() {
const [pulled, puller] = useTalentPuller()
const [talents, picker] = useTalentPicker()
const { enabled, min, max } = useSubmitIsEnable()
const submit = useTalentSubmit()
// useEffect(puller, [])
if (!pulled)
return (
<div className="screen talent-pick">
<button
className="primary font-mono focus"
onClick={() => puller()}
>
{PullCount} !
</button>
</div>
)
const ps = dev.locked
? Array.from(new Set([...dev.locked, ...pulled]))
: pulled
return (
<div className="screen talent-pick">
<ul className="talent-list">
{ps.map(id => (
<li key={id} onClick={() => picker(id)}>
<Talent id={id} selected={talents.has(id)} />
</li>
))}
</ul>
{enabled ? (
<button className="primary" onClick={() => submit()}>
</button>
) : (
<button className="error">
{min == max ? min : `${min}~${max}`}
</button>
)}
</div>
)
}
export default Pick