import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { useTheme } from '../../theme';
export const SplitButton = ({ primaryLabel, secondaryLabel, primaryIcon, secondaryIcon, onPrimaryClick, onSecondaryClick, primaryAriaLabel, secondaryAriaLabel, primaryAriaControls, secondaryAriaControls, primaryPressed, secondaryPressed, primaryTitle, secondaryTitle, className, primaryClassName, secondaryClassName, primaryDisabled = false, secondaryDisabled = false }) => {
    const theme = useTheme();
    const baseButtonClass = theme.chatHeader?.secondaryButton ?? '';
    const containerClassName = [
        'inline-flex rounded-md shadow-sm overflow-hidden',
        className
    ].filter(Boolean).join(' ');
    const primaryButtonClassName = [
        baseButtonClass,
        'rounded-r-none border-r-0 shadow-none focus:z-10',
        primaryClassName
    ].filter(Boolean).join(' ');
    const secondaryButtonClassName = [
        baseButtonClass,
        'rounded-l-none shadow-none -ml-px focus:z-10',
        secondaryClassName
    ].filter(Boolean).join(' ');
    return (_jsxs("div", { role: 'group', className: containerClassName, children: [_jsxs("button", { type: 'button', onClick: onPrimaryClick, className: primaryButtonClassName, "aria-label": primaryAriaLabel, "aria-pressed": primaryPressed, "aria-controls": primaryAriaControls, title: primaryTitle, disabled: primaryDisabled, children: [primaryIcon ? (_jsx("span", { className: 'mr-1 inline-flex items-center', children: primaryIcon })) : null, _jsx("span", { children: primaryLabel })] }), _jsxs("button", { type: 'button', onClick: onSecondaryClick, className: secondaryButtonClassName, "aria-label": secondaryAriaLabel, "aria-pressed": secondaryPressed, "aria-controls": secondaryAriaControls, title: secondaryTitle, disabled: secondaryDisabled, children: [secondaryIcon ? (_jsx("span", { className: 'inline-flex items-center', children: secondaryIcon })) : null, secondaryLabel ? (_jsx("span", { className: secondaryIcon ? 'ml-1' : '', children: secondaryLabel })) : null] })] }));
};
export default SplitButton;
