import Markdown from "react-markdown"; import { faCircle, faTrash } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { formatDistance } from "date-fns"; import { twMerge } from "tailwind-merge"; import { IconButton, Tooltip } from "@app/components/v2"; import { TUserNotification } from "@app/hooks/api/notifications/types"; type Props = { notification: TUserNotification; onDelete: (notificationId: string) => void; }; export const Notification = ({ notification, onDelete }: Props) => { return (
{!notification.isRead && ( )} {notification.title}} delayDuration={300} className="z-1000" > {notification.title} {formatDistance(notification.createdAt, new Date())} ago
{notification.body && ( {notification.body} )}
{ e.stopPropagation(); onDelete(notification.id); }} >
); };