core/components/Message.tsx
SKINMAKER b421d1ab64
chore: apply prettier (#637)
* chore: apply prettier

* chore: edit ready comment

* chore: move ts comment
2023-11-29 22:04:33 +09:00

20 lines
504 B
TypeScript

import { MessageColor } from '@utils/Constants'
import Markdown from './Markdown'
const Message: React.FC<MessageProps> = ({ type, children }) => {
return (
<div
className={`${MessageColor[type]} mx-auto w-full rounded-md px-6 py-4 text-left text-base`}
>
{typeof children === 'string' ? <Markdown text={children} /> : children}
</div>
)
}
interface MessageProps {
type?: 'success' | 'error' | 'warning' | 'info'
children: JSX.Element | JSX.Element[] | string
}
export default Message