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