mirror of
https://github.com/koreanbots/core.git
synced 2025-12-15 14:10:22 +00:00
20 lines
506 B
TypeScript
20 lines
506 B
TypeScript
import { MessageColor } from '@utils/Constants'
|
|
import Markdown from './Markdown'
|
|
|
|
const Message: React.FC<MessageProps> = ({ type, children }) => {
|
|
return (
|
|
<div
|
|
className={`${MessageColor[type]} px-6 py-4 rounded-md text-base mx-auto w-full text-left`}
|
|
>
|
|
{ typeof children === 'string' ? <Markdown text={children} /> : children }
|
|
</div>
|
|
)
|
|
}
|
|
|
|
interface MessageProps {
|
|
type?: 'success' | 'error' | 'warning' | 'info'
|
|
children: JSX.Element | JSX.Element[] | string
|
|
}
|
|
|
|
export default Message
|