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

import { jsx as _jsx } from "react/jsx-runtime";
import { useRef } from 'react';
import { useEvent } from '../../../../_internal/index.js';
import { tasty } from '../../../../tasty/index.js';
import { useNotificationListItem } from '../hooks/index.js';
import { NotificationView } from '../NotificationView/index.js';
const NotificationListItemWrap = tasty({
    styles: { borderBottom: { '': '1bw solid #border', ':last-child': 'none' } },
});
/**
 * @internal This component is not intended to be used
 */
export function NotificationListItem(props) {
    const { item, state, onDismiss } = props;
    const { key, props: notificationProps } = item;
    const ref = useRef(null);
    const onDismissEvent = useEvent(() => onDismiss?.(key));
    const { itemProps } = useNotificationListItem({ ref, key, state });
    return (_jsx(NotificationListItemWrap, { children: _jsx(NotificationView, { ref: ref, attributes: itemProps, ...notificationProps, isDismissible: !!onDismiss, onDismiss: onDismissEvent }) }));
}

        