import Select from '../../../components/Select'
import { DIFFICULTIES, formatMeso, getDifficultyImageUrl } from '../admin/constants'
export default function BossSelector({ characterName, bosses, selections, onChange, maxReached, selectedCount, maxPerCharacter }) {
if (!characterName) {
return (
좌측에서 캐릭터를 선택해주세요
)
}
if (bosses.length === 0) {
return (
등록된 보스가 없습니다
)
}
return (
{/* 헤더 (고정) */}
{/* 목록 (스크롤) */}
{bosses.map((boss) => {
const availableDiffs = DIFFICULTIES.filter((d) =>
boss.difficulties.some((bd) => bd.difficulty === d.key)
)
const sel = selections[boss.id]
const bdInfo = sel ? boss.difficulties.find((bd) => bd.difficulty === sel.difficulty) : null
const partyN = sel?.party || 1
const revenue = bdInfo ? Math.floor(bdInfo.crystal_price / partyN) : 0
const partyOptions = Array.from({ length: boss.max_party_size }, (_, i) => i + 1).map((n) => ({
value: n,
label: `${n}인`,
}))
// 한도 도달 + 이 보스가 선택 안 됐으면 비활성화
const disabled = maxReached && !sel
return (
{/* 보스 이미지 + 이름 */}
{/* 난이도 - 한 줄 고정 */}
{availableDiffs.map((d) => {
const active = sel?.difficulty === d.key
return (
)
})}
{/* 파티 인원 - 커스텀 Select */}
{sel ? (
{/* 수익 */}
{sel ? formatMeso(revenue) : '-'}
)
})}
)
}