/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-af8d194 | Cube Dev Team */
import { tasty } from "../../../../tasty/tasty.js";
import { useEvent } from "../../../../_internal/hooks/use-event.js";
import { useNotificationListItem } from "../hooks/use-notification-list-item.js";
import { NotificationView } from "../NotificationView/NotificationView.js";
import { useRef } from "react";
import { jsx } from "react/jsx-runtime";

//#region src/components/overlays/NewNotifications/NotificationsList/NotificationsListItem.tsx
const NotificationListItemWrap = tasty({ styles: { borderBottom: {
	"": "1bw solid #border",
	":last-child": "none"
} } });
/**
* @internal This component is not intended to be used
*/
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 /* @__PURE__ */ jsx(NotificationListItemWrap, { children: /* @__PURE__ */ jsx(NotificationView, {
		ref,
		attributes: itemProps,
		...notificationProps,
		isDismissible: !!onDismiss,
		onDismiss: onDismissEvent
	}) });
}

//#endregion
export { NotificationListItem };
//# sourceMappingURL=NotificationsListItem.js.map