import { useState } from "react"; import { IconDefinition } from "@fortawesome/fontawesome-svg-core"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { twMerge } from "tailwind-merge"; interface Option { value: string; icon: IconDefinition; } interface ButtonIconSelectProps { options: Option[]; onOptionChange?: (value: string) => void; } export function ButtonIconSelect({ options, onOptionChange, }: ButtonIconSelectProps) { const [selectedOption, setSelectedOption] = useState( options[0].value, ); const handleOptionChange = (value: string) => { setSelectedOption(value); if (onOptionChange) { onOptionChange(value); } }; return (
{options.map(({ value, icon }) => ( ))}
); }