// Copyright 2024, Command Line Inc. // SPDX-License-Identifier: Apache-2.0 import { Button } from "@/element/button"; import { makeIconClass } from "@/util/util"; import clsx from "clsx"; import "./notificationitem.scss"; interface NotificationItemProps { notification: NotificationType; onRemove: (id: string) => void; onCopy: (id: string) => void; onActionClick: (e: React.MouseEvent, action: NotificationActionType, id: string) => void; formatTimestamp: (timestamp: string) => string; isBubble: boolean; className?: string; onMouseEnter?: () => void; onMouseLeave?: () => void; } const NotificationItem = ({ notification, onRemove, onCopy, onActionClick, formatTimestamp, isBubble, className, onMouseEnter, onMouseLeave, }: NotificationItemProps) => { const { id, title, message, icon, type, timestamp, persistent, actions } = notification; const color = type === "error" ? "red" : type === "warning" ? "yellow" : "green"; const nIcon = icon ? icon : "bell"; const renderCloseButton = () => { if (!isBubble && persistent) { return ( ); } return ( ); }; return (