import { useState } from 'react' import Select from '../../../components/Select' import Tooltip from '../../../components/Tooltip' 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} ) } function BossRow({ boss, sel, onChange, monthly = false }) { 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 && 월간}
onChange({ party: v })} options={PARTY_OPTIONS} disabled={disabled} />
) } export default function WeeklyDefault({ weekly, onChange, totalWeekly, totalMonthly }) { const [mode, setMode] = useState('simple') // 'simple' | 'weekly' const updateBoss = (key, patch) => { onChange({ ...weekly, bosses: { ...weekly.bosses, [key]: { ...weekly.bosses[key], ...patch } } }) } const updateBlackMage = (patch) => { onChange({ ...weekly, blackMage: { ...weekly.blackMage, ...patch } }) } return (
주간 보스 설정
setMode('simple')}>단순 계산 setMode('weekly')}>주차별 계산
{mode === 'simple' ? ( <>
주간 획득 +{totalWeekly} 월간 획득 +{totalMonthly}
{WEEKLY_BOSSES.map((boss) => ( updateBoss(boss.key, patch)} /> ))} {MONTHLY_BOSSES.map((boss) => ( ))}
) : (
주차별 계산 UI 준비 중
)}
) } function TabButton({ active, onClick, children }) { return ( ) }