You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
623 B
26 lines
623 B
import React, { FC } from 'react'
|
|
import { useTheme } from 'src/hooks'
|
|
import { NotificationType, FormNotification } from 'src/types'
|
|
|
|
interface Props {
|
|
notification: FormNotification
|
|
}
|
|
|
|
const Notification: FC<Props> = ({ notification }) => {
|
|
const theme = useTheme()
|
|
let color = theme.text
|
|
|
|
switch (notification.type) {
|
|
case NotificationType.Error:
|
|
color = theme.red
|
|
break
|
|
case NotificationType.Success:
|
|
color = theme.green
|
|
}
|
|
|
|
return (
|
|
<p className="help" style={{ color }}>{notification.message}</p>
|
|
)
|
|
}
|
|
|
|
export default Notification
|