| 1 |
import React from 'react'; |
| 2 |
import { styled } from '@linaria/react'; |
| 3 |
import { MARIGOLD_LIGHT, MARIGOLD_MEDIUM, OBSIDIAN } from './colors'; |
| 4 |
|
| 5 |
const AlertContainer = styled.div` |
| 6 |
background-color: ${MARIGOLD_LIGHT}; |
| 7 |
border-color: ${MARIGOLD_MEDIUM}; |
| 8 |
color: ${OBSIDIAN}; |
| 9 |
font-size: 14px; |
| 10 |
align-items: center; |
| 11 |
justify-content: space-between; |
| 12 |
display: flex; |
| 13 |
border-style: solid; |
| 14 |
border-top-style: solid; |
| 15 |
border-right-style: solid; |
| 16 |
border-bottom-style: solid; |
| 17 |
border-left-style: solid; |
| 18 |
border-width: 1px; |
| 19 |
min-height: 60px; |
| 20 |
padding: 8px 20px; |
| 21 |
position: relative; |
| 22 |
text-align: left; |
| 23 |
`; |
| 24 |
|
| 25 |
const Title = styled.p` |
| 26 |
font-family: 'Lexend Deca'; |
| 27 |
font-style: normal; |
| 28 |
font-weight: 700; |
| 29 |
font-size: 16px; |
| 30 |
line-height: 19px; |
| 31 |
color: ${OBSIDIAN}; |
| 32 |
margin: 0; |
| 33 |
padding: 0; |
| 34 |
`; |
| 35 |
|
| 36 |
const Message = styled.p` |
| 37 |
font-family: 'Lexend Deca'; |
| 38 |
font-style: normal; |
| 39 |
font-weight: 400; |
| 40 |
font-size: 14px; |
| 41 |
margin: 0; |
| 42 |
padding: 0; |
| 43 |
`; |
| 44 |
|
| 45 |
const MessageContainer = styled.div` |
| 46 |
display: flex; |
| 47 |
flex-direction: column; |
| 48 |
`; |
| 49 |
|
| 50 |
interface IUIAlertProps { |
| 51 |
titleText: string; |
| 52 |
titleMessage: string; |
| 53 |
} |
| 54 |
|
| 55 |
export default function UIAlert({ |
| 56 |
titleText, |
| 57 |
titleMessage, |
| 58 |
children, |
| 59 |
}: React.PropsWithChildren<IUIAlertProps>) { |
| 60 |
return ( |
| 61 |
<AlertContainer> |
| 62 |
<MessageContainer> |
| 63 |
<Title>{titleText}</Title> |
| 64 |
<Message>{titleMessage}</Message> |
| 65 |
</MessageContainer> |
| 66 |
{children} |
| 67 |
</AlertContainer> |
| 68 |
); |
| 69 |
} |
| 70 |
|