({
className,
title,
children,
type = AlertType.Info,
flexDirection = 'flex-col',
}: AlertProps)
| 46 | export const AlertParagraph = classed('p', 'typo-callout mt-3'); |
| 47 | |
| 48 | function Alert({ |
| 49 | className, |
| 50 | title, |
| 51 | children, |
| 52 | type = AlertType.Info, |
| 53 | flexDirection = 'flex-col', |
| 54 | }: AlertProps): ReactElement { |
| 55 | const Icon = iconType[type]; |
| 56 | |
| 57 | return ( |
| 58 | <div |
| 59 | className={classNames( |
| 60 | 'flex border border-l-4 border-theme-active p-3', |
| 61 | flexDirection, |
| 62 | borderColor[type], |
| 63 | children ? 'rounded-16' : 'rounded-12', |
| 64 | className, |
| 65 | )} |
| 66 | > |
| 67 | <span className="flex flex-row items-center"> |
| 68 | <Icon |
| 69 | size={IconSize.Small} |
| 70 | className={classNames('mr-2', fontColor[type])} |
| 71 | /> |
| 72 | <span |
| 73 | className={classNames( |
| 74 | 'flex flex-1 typo-callout', |
| 75 | !!children && 'font-bold', |
| 76 | !!children && fontColor[type], |
| 77 | )} |
| 78 | > |
| 79 | {title} |
| 80 | </span> |
| 81 | </span> |
| 82 | {children} |
| 83 | </div> |
| 84 | ); |
| 85 | } |
| 86 | |
| 87 | export default Alert; |
nothing calls this directly
no outgoing calls
no test coverage detected