import{__assign as e}from"tslib";import{jsxs as o,Fragment as i,jsx as a}from"react/jsx-runtime";import{X as t,TriangleAlert as l}from"lucide-react";import{Typography as n}from"@mui/material";import r from"../InstantLearning.module.css.js";import{componentStyles as s}from"./ILPopup.styles.js";import{TemplateMap as d}from"./templates/TemplatesMap/templatesMap.js";var c=function(c){var m=c.customSections,u=c.showCustomSections,p=void 0===u||u,v=c.onSave,f=c.formHeader,g=c.onClose,h=c.validateCustom,b=c.template,x=c.templateProps,S=c.isLoading,C=c.saveButtonConfig,y=void 0===C?{label:"Save Learning",loadingLabel:"Saving Learning..."}:C,L=c.isAiStreaming,w=void 0!==L&&L,N=c.showSaveWithoutValidation,j=c.saveWithoutValBtnConfig,k=void 0===j?{label:"Save w/o validation",loadingLabel:"Saving w/o validation..."}:j,W=c.onSaveWithoutValidation,B=c.saveButtonColor,P=b?d[b]:null,E=!h||h();return o(i,{children:[a("style",{children:s}),o("div",e({className:"il-popup-container ".concat(r.customFont)},{children:[o("div",e({className:"form-header"},{children:[a(n,e({sx:{fontSize:"1.125rem",fontWeight:500,lineHeight:"1.82rem",fontFamily:'"Plus Jakarta Sans", sans-serif'}},{children:f})),a("div",e({onClick:g,style:{cursor:"pointer"}},{children:a(t,{})}))]})),a("div",e({style:{flexGrow:1,display:"flex",flexDirection:"column",width:"100%",padding:"20px 24px",overflowY:"auto",borderBottom:"1px solid #E7E7E9"}},{children:o("div",e({className:"sections-space"},{children:[P&&a(P,e({},x)),p&&m]}))})),o("div",e({className:"save-button-container"},{children:[N&&o("button",e({className:"save-button-secondary",onClick:function(){W&&E&&W()},disabled:S||!E||w},{children:[a(l,{size:16,style:{marginRight:"4px"}}),S?k.loadingLabel:k.label]})),a("button",e({className:"save-button",onClick:function(){!h||h()?(v(),console.log("Form Data to Save:")):console.error("Please fill all required fields before saving the learning.")},disabled:S||!E||w,style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",maxWidth:"fit-content",backgroundColor:B,borderColor:B}},{children:S?y.loadingLabel:y.label}))]}))]}))]})};export{c as default};
//# sourceMappingURL=ILPopup.js.map
