import { useState } from 'react'
import Select from '../../../components/Select'
import Tooltip from '../../../components/Tooltip'
import WeeklyDesignMocks from './WeeklyDesignMocks'
import { WEEKLY_BOSSES, MONTHLY_BOSSES, LIBERATION_BOSS_IMAGE_BASE, calcPoints } from '../data'
const PARTY_OPTIONS = [1, 2, 3, 4, 5, 6].map((n) => ({ value: n, label: `${n}인` }))
const NONE_DIFFICULTY = { key: 'none', label: '격파 불가', points: 0 }
function diffLabel(d, party) {
if (d.key === 'none') return 격파 불가
const earned = calcPoints(d.points, party)
return (
{d.label} +{earned}
)
}
export function BossRow({ boss, sel, onChange, monthly = false, showDone = true }) {
const disabled = sel.difficulty === 'none'
const difficultyOptions = [NONE_DIFFICULTY, ...boss.difficulties]
.map((d) => ({ value: d.key, label: diffLabel(d, sel.party) }))
return (
{boss.name}
{monthly && 월간}
{showDone && (
)}
)
}
export default function WeeklyDefault({ weekly, onChange, totalWeekly, totalMonthly, mode = 'simple' }) {
const updateBoss = (key, patch) => {
onChange({ ...weekly, bosses: { ...weekly.bosses, [key]: { ...weekly.bosses[key], ...patch } } })
}
const updateBlackMage = (patch) => {
onChange({ ...weekly, blackMage: { ...weekly.blackMage, ...patch } })
}
return (
주간 보스 설정
주간 획득 +{totalWeekly}
월간 획득 +{totalMonthly}
{mode === 'simple' ? (
{WEEKLY_BOSSES.map((boss) => (
updateBoss(boss.key, patch)}
/>
))}
{MONTHLY_BOSSES.map((boss) => (
))}
) : (
)}
)
}