@bothub-chat/ui
Version:
Bothub UI Components
2 lines (1 loc) • 960 B
JavaScript
import{jsx as e,jsxs as r}from"react/jsx-runtime";import{useTransition as o}from"@react-spring/web";import{forwardRef as t}from"react";import{ModalWindowContent as l,ModalWindowStyled as i,ModalWindowBody as s,ModalWindowTitle as c,ModalWindowCloseButton as n,ModalWindowCloseButtonIcon as a,ModalWindowBodyContent as m,ModalWindowBodyScrollbarWrapper as d}from"./styled.js";const f=t((({children:t,open:f,title:p=null,scrollbar:h=!1,images:u,className:y,hideCloseButton:g=!1,onClose:b},v)=>{const C=o(f,{from:{opacity:0,transform:"scale(0.9)"},enter:{opacity:1,transform:"scale(1)"},leave:{opacity:0,transform:"scale(0.9)"},config:{duration:200}}),j=e(l,{children:t});return C(((o,t)=>t&&r(i,{ref:v,style:o,className:y,children:[u,r(s,{children:["string"==typeof p?e(c,{children:p}):p,!g&&e(n,{onClick:b,"data-test":"close modal",children:e(a,{size:24})}),e(m,{children:h?e(d,{overflow:h?"auto":"visible",children:j}):j})]})]})))}));export{f as ModalWindow};