import PickCard from './PickCard';

const TIER_TITLE = {
    core: '코어 (필수, 5세트)',
    bonus: '보너스 (+5)',
    extended: '확장 (+5)',
    pool: '풀 (+5)',
};

export default function TierSection({ tier, picks, rationale, indexBase = 0, totalSets }) {
    if (!picks?.length) return null;
    return (
        <section className={`lc-tier lc-tier--${tier}`}>
            <header className="lc-tier__head">
                <h4>{TIER_TITLE[tier]}</h4>
                {rationale && tier !== 'core' && (
                    <p className="lc-tier__rationale">{rationale}</p>
                )}
            </header>
            {picks.map((p, i) => (
                <PickCard key={i} pick={p} index={indexBase + i} total={totalSets} />
            ))}
        </section>
    );
}
