@legion-ui-kit/react-core
Version:
To install the package into your project:
3 lines (2 loc) • 924 B
JavaScript
import{jsxs as s,jsx as e}from"react/jsx-runtime";import t from"classnames";import l from"./styles.module.scss.js";import{ALERT_DEFAULT_PROPS as a,DEFAULT_ICON as c,ALERT_COLORS as i}from"./Alert.constant.js";const n=n=>{const{className:o,color:r=a.color,description:m,descriptionClassName:d,leftIcon:h,leftIconClassName:p,noLeftIcon:N,rightIcon:f,rightIconClassName:_,title:u,titleClassName:g,...I}=n,C=i.includes(r)?c[r]:c.information,j=t(l.legion_alert,o,l[r],{[l.has_right_icon]:!!f,[l.no_title]:!u}),v=t(l.description,d),x=t(l.title,g),y=t(l.left_icon,p),A=t(l.right_icon,_);return s("div",{className:j,...I,children:[!N&&e("span",{className:y,children:h||e("i",{className:l.default_icon,children:C})}),s("div",{className:l.alert_content,children:[u&&e("p",{className:x,children:u}),m&&e("p",{className:v,children:m})]}),f&&e("span",{className:A,children:f})]})};export{n as default};
//# sourceMappingURL=index.js.map