core/components/Message.tsx
2021-01-30 21:23:05 +09:00

14 lines
389 B
TypeScript

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