// to be kept in sync with app/views/_mixins/notification.pug
import classNames from 'classnames'
import React, { ReactElement, useState } from 'react'
import { useTranslation } from 'react-i18next'
import MaterialIcon from './material-icon'
export type NotificationType =
| 'info'
| 'success'
| 'warning'
| 'error'
| 'offer'
export type NotificationProps = {
action?: React.ReactElement
ariaLive?: 'polite' | 'off' | 'assertive'
className?: string
content: React.ReactNode
customIcon?: React.ReactElement | null
iconPlacement?: 'top' | 'center'
disclaimer?: React.ReactElement | string
isDismissible?: boolean
isActionBelowContent?: boolean
onDismiss?: () => void
title?: string
type: NotificationType
id?: string
}
export function NotificationIcon({
notificationType,
customIcon,
iconPlacement,
}: {
notificationType: NotificationType
customIcon?: ReactElement
iconPlacement?: 'top' | 'center'
}) {
let icon =
{title}
)} {content}