in 9-realtime/openai-realtime-console-example/src/components/button/Button.tsx [15:50]
export function Button({
label = 'Okay',
icon = void 0,
iconPosition = 'start',
iconColor = void 0,
iconFill = false,
buttonStyle = 'regular',
...rest
}: ButtonProps) {
const StartIcon = iconPosition === 'start' ? icon : null;
const EndIcon = iconPosition === 'end' ? icon : null;
const classList = [];
if (iconColor) {
classList.push(`icon-${iconColor}`);
}
if (iconFill) {
classList.push(`icon-fill`);
}
classList.push(`button-style-${buttonStyle}`);
return (
<button data-component="Button" className={classList.join(' ')} {...rest}>
{StartIcon && (
<span className="icon icon-start">
<StartIcon />
</span>
)}
<span className="label">{label}</span>
{EndIcon && (
<span className="icon icon-end">
<EndIcon />
</span>
)}
</button>
);
}