mirror of
https://github.com/VickScarlet/lifeRestart.git
synced 2026-08-28 01:06:49 +08:00
21 lines
588 B
TypeScript
21 lines
588 B
TypeScript
import { type Talent as T, talents } from '@remake/data'
|
|
import './Talent.css'
|
|
|
|
export interface TalentProps {
|
|
id: T['id']
|
|
selected?: boolean
|
|
}
|
|
export function Talent({ id, selected }: TalentProps) {
|
|
const talent = talents.get(id)
|
|
if (!talent) return null
|
|
const grade = talent?.grade ?? 0
|
|
return (
|
|
<div className={`talent grade-${grade} ${selected ? 'selected' : ''}`}>
|
|
<span className="talent-name">{talent.name}</span>
|
|
<span className="talent-description">{talent.description}</span>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default Talent
|