mirror of
https://github.com/VickScarlet/lifeRestart.git
synced 2026-08-28 09:16:47 +08:00
update: rename component
This commit is contained in:
@@ -1,23 +1,23 @@
|
||||
import { type Talent, talents } from '@remake/data'
|
||||
import TalentComponent from './Talent'
|
||||
import { type Talent as T, talents } from '@remake/data'
|
||||
import Talent from './Talent'
|
||||
import './Replaced.css'
|
||||
|
||||
export interface TalentProps {
|
||||
id: Talent['id']
|
||||
chains?: Talent['id'][]
|
||||
id: T['id']
|
||||
chains?: T['id'][]
|
||||
}
|
||||
export function Replaced({ id, chains }: TalentProps) {
|
||||
return (
|
||||
<ul className="replaced">
|
||||
<li>
|
||||
<TalentComponent id={id} selected={true} />
|
||||
<Talent id={id} selected={true} />
|
||||
</li>
|
||||
{chains?.map(id => {
|
||||
const talent = talents.get(id)
|
||||
if (!talent) return null
|
||||
return (
|
||||
<li key={id}>
|
||||
<TalentComponent id={id} selected={false} />
|
||||
<Talent id={id} selected={false} />
|
||||
</li>
|
||||
)
|
||||
})}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { type Talent, talents } from '@remake/data'
|
||||
import { type Talent as T, talents } from '@remake/data'
|
||||
import './Talent.css'
|
||||
|
||||
export interface TalentProps {
|
||||
id: Talent['id']
|
||||
id: T['id']
|
||||
selected?: boolean
|
||||
}
|
||||
export function TalentComponent({ id, selected }: TalentProps) {
|
||||
export function Talent({ id, selected }: TalentProps) {
|
||||
const talent = talents.get(id)
|
||||
if (!talent) return null
|
||||
const grade = talent?.grade ?? 0
|
||||
@@ -17,4 +17,4 @@ export function TalentComponent({ id, selected }: TalentProps) {
|
||||
)
|
||||
}
|
||||
|
||||
export default TalentComponent
|
||||
export default Talent
|
||||
|
||||
Reference in New Issue
Block a user