mirror of
https://github.com/VickScarlet/lifeRestart.git
synced 2026-08-28 01:06:49 +08:00
22 lines
645 B
TypeScript
22 lines
645 B
TypeScript
import type { Talent } from '@remake/data/talent'
|
|
import talents from '@remake/data/talent'
|
|
import './Talent.css'
|
|
|
|
export interface TalentProps {
|
|
id: Talent['id']
|
|
selected: boolean
|
|
}
|
|
export function TalentComponent({ 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 TalentComponent
|