import { TARGETS } from "@/constants/targets" type TargetGroup = (typeof TARGETS)[string] & { id: string } interface TargetSelectorProps { activeCategory: string categories: string[] groupedTargets: Record selectedTarget: string compatibleTargets: Set | null onCategoryChange: (category: string) => void onTargetSelect: (targetId: string) => void } export function TargetSelector({ activeCategory, categories, groupedTargets, selectedTarget, compatibleTargets, onCategoryChange, onTargetSelect, }: TargetSelectorProps) { const targets = activeCategory ? groupedTargets[activeCategory] : [] return (
{categories.map(category => { const isActive = activeCategory === category return ( ) })}
{targets?.map(target => { const isSelected = selectedTarget === target.id const normalizedId = target.id.replace(/[-_]/g, "") const isCompatible = !compatibleTargets || compatibleTargets.has(target.id) || compatibleTargets.has(normalizedId) return ( ) })}
) }