'use client'; import { useState } from "react"; import "./Selection.css"; function Selection() { const [selected, setSelected] = useState(null); const options = [ { name: "WINDOWS", img: "https://images.icon-icons.com/2235/PNG/512/windows_os_logo_icon_134678.png", }, { name: "MACINTOSH", img: "https://upload.wikimedia.org/wikipedia/commons/f/fa/Apple_logo_black.svg", }, { name: "PROFESORES", img: "https://cdn-icons-png.flaticon.com/512/3135/3135715.png", }, ]; const handleSelect = (optionName: string) => { setSelected(selected === optionName ? null : optionName); }; return (
{options.map((option, index) => (
handleSelect(option.name)} > {option.name}
))}
); } export default Selection;