import React from 'react'; import styled from 'styled-components'; import { colors } from 'ts/style/colors'; interface INotificationWrapperProps { type?: 'standard' | 'alert' | 'success'; } interface INotificationProps extends INotificationWrapperProps { children: string; } export const Notification: React.FC = ({ children, type = 'standard' }) => ( {themeSettings[type].icon} {children} ); const NotificationWrapper = styled.div` display: flex; align-items: center; padding: 1rem; margin-bottom: 1.875rem; color: ${colors.textDarkPrimary}; background-color: ${({ type }) => themeSettings[type].bgColor}; svg { min-width: 28px; } `; const NotificationText = styled.span` font-size: 1rem; line-height: 26px; margin-left: 1rem; `; const themeSettings = { success: { bgColor: 'rgba(0, 174, 153, 0.1)', icon: ( ), }, standard: { bgColor: '#F2F2F2', icon: ( ), }, alert: { bgColor: '#FFFAF3', icon: ( ), }, };