import { __rest } from '../../../_virtual/_tslib.js';
import React__default from 'react';
import { ToastCompactWrapper, CompactWrapper, MessageWrapper, CompactActionWrapper } from './styles.js';
import { getId } from '../../../utils/index.js';
import { Button } from '../../Button/index.js';
import { getAriaRole } from './utils.js';
import ToastIcon from './ToastIcon.js';

function ToastCompact(_a) {
    var { className, message, variant = 'neutral', icon, primaryAction } = _a, props = __rest(_a, ["className", "message", "variant", "icon", "primaryAction"]);
    const appendTestId = getId(props['data-testid']);
    const appendTrackId = getId(props['data-trackid']);
    return (React__default.createElement(ToastCompactWrapper, { className: className, variant: variant, "data-testid": appendTestId('wrapper'), "data-trackid": appendTrackId('wrapper'), "aria-label": props['aria-label'], role: getAriaRole(variant) },
        React__default.createElement(CompactWrapper, null,
            variant === 'neutral' && icon ? icon : React__default.createElement(ToastIcon, { variant: variant }),
            React__default.createElement(MessageWrapper, null, message),
            primaryAction && (React__default.createElement(CompactActionWrapper, null,
                React__default.createElement(Button, { size: "xSmall", variant: "inverse-ghost", onClick: primaryAction.onClick, "data-testid": appendTestId('action-button') }, primaryAction.text))))));
}

export { ToastCompact };
