Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | import React from "react"; function RadioOptions({ options, handleSelect, selectedId }) { return ( <div className="flex items-center mt-2 overflow-hidden w-fit"> {options.map((option) => ( <button key={option.id} onClick={(e) => handleSelect(option)} className={`${ selectedId === option.id ? "!bg-white !text-violet-500 border-violet-500" : "text-gray-500 bg-gray-50 border-gray-200" } p-2 text-sm hover:bg-gray-100 cursor-pointer transition-all rounded border`}> {option.label} </button> ))} </div> ); } export default RadioOptions; |