update: hooks, web

This commit is contained in:
Vick Scarlet
2026-08-16 20:06:16 +08:00
committed by 神戸小鳥
parent 2f91709d1e
commit 322f775796
67 changed files with 2339 additions and 2243 deletions
+39
View File
@@ -0,0 +1,39 @@
// import { useEffect } from 'react'
import { useTalentPuller, useTalentPicker } from '@remake/hooks'
import { useTalentSubmit, useSubmitIsEnable } from '@remake/hooks'
import TalentComponent from '@/components/Talent'
import './TalentPick.css'
export default function TalentPick() {
const [pulled, puller] = useTalentPuller()
const [talents, picker] = useTalentPicker()
const [enabled, limit] = useSubmitIsEnable()
const submit = useTalentSubmit()
// useEffect(puller, [])
if (!pulled)
return (
<div className="screen talent-pick">
<button className="primary" onClick={() => puller()}>
</button>
</div>
)
return (
<div className="screen talent-pick">
<ul className="talent-list">
{pulled.map(id => (
<li key={id} onClick={() => picker(id)}>
<TalentComponent id={id} selected={talents.has(id)} />
</li>
))}
</ul>
{enabled ? (
<button className="primary" onClick={() => submit()}>
</button>
) : (
<button className="error"> {limit} </button>
)}
</div>
)
}