import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
import { GlobalStyles } from '@mui/material';
import Button from '../../../Buttons/Button';
import { AIIcon } from '../../shared/AIIcon';
import { AI_PROPERTIES } from '../../shared/constants';
import { StopIcon } from '../../shared/StopIcon';
import { useAIVariantSx } from '../../shared/useAIVariantSx';
export const AIButton = ({ variant = 'primary', size = 'large', icon = 'sparkles', loading = false, onStop, onClick, children, sx, ...rest }) => (_jsxs(_Fragment, { children: [_jsx(GlobalStyles, { styles: AI_PROPERTIES }), _jsxs(Button, { variant: variant, size: size, onClick: loading ? onStop : onClick, startIcon: !loading && _jsx(AIIcon, { name: icon }), "aria-busy": loading || undefined, sx: useAIVariantSx(variant, sx), ...rest, children: [loading && _jsx(StopIcon, {}), !loading && children] })] }));
