"use client"; import { useState } from "react"; import "./Selection.css"; function Selection({ plataformasInscritas = [], onSelect, }: { plataformasInscritas: string[]; onSelect: (plataforma: string | null) => void; }) { const [selected, setSelected] = useState(null); const handleSelect = (optionName: string) => { const value = selected === optionName ? null : optionName; setSelected(value); onSelect(value); }; const options = [ { name: "WINDOWS", img: "/windows.png", }, { name: "MACINTOSH", img: "apple.png", }, { name: "PROFESORES", img: "teacher.png", }, ]; const opcionesDisponibles = options.filter( (option) => !plataformasInscritas.includes(option.name), ); return (
{opcionesDisponibles.map((option, index) => (
handleSelect(option.name)} > {option.name}
))} {opcionesDisponibles.length === 0 && (

El alumno ya está inscrito en todas las plataformas

)}
); } export default Selection;