1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-06-29 00:57:50 +02:00
market/src/components/atoms/Alert.tsx

20 lines
436 B
TypeScript

import React, { ReactElement } from 'react'
import styles from './Alert.module.css'
export default function Alert({
title,
text,
state
}: {
title?: string
text: string
state: 'error' | 'warning' | 'info' | 'success'
}): ReactElement {
return (
<div className={`${styles.alert} ${styles[state]}`}>
{title && <h3 className={styles.title}>{title}</h3>}
<p className={styles.text}>{text}</p>
</div>
)
}