/**
 * @license MIT
 * author: Cube Dev Team
 * @cube-dev/ui-kit v0.0.0-canary-3803e7e
 * Released under the MIT license.
 */

import { jsx as _jsx } from "react/jsx-runtime";
import { forwardRef } from 'react';
import { tasty } from '../../../tasty/index.js';
import { Item } from '../../content/Item/Item.js';
import { getThemeIcon } from './useToast.js';
const StyledItem = tasty(Item, {
    styles: {
        shadow: '$card-shadow',
        transition: 'theme, inset',
        pointerEvents: 'none',
        Description: {
            preset: 't4',
        },
    },
});
export const ToastItem = forwardRef(function ToastItem(props, ref) {
    const { title, description, theme, isLoading, icon: providedIcon, children, qa, ...itemProps } = props;
    const icon = getThemeIcon(theme, providedIcon, isLoading);
    // If only description provided (no title/children), use description as primary content
    const primaryContent = children ?? title ?? description;
    const secondaryContent = children || title ? description : undefined;
    return (_jsx(StyledItem, { ref: ref, qa: qa ?? 'Toast', type: "card", theme: theme, icon: icon, isLoading: isLoading, description: secondaryContent, ...itemProps, children: primaryContent }));
});

        