| 1 |
"use strict";(self.webpackChunk_bitforms=self.webpackChunk_bitforms||[]).push([[1252],{523:(t,e,s)=>{s.d(e,{Z:()=>n});var i=s(5893);function n(t){var e=t.className,s=t.stroke,n=void 0===s?2:s,l=t.size,r=void 0===l?14:l;return(0,i.jsxs)("svg",{className:e,xmlns:"http://www.w3.org/2000/svg",width:r,height:r,viewBox:"0 0 30 30",children:[(0,i.jsx)("path",{className:"svg-icn",strokeWidth:n,d:"M13.83,6.32H6.11a2.19,2.19,0,0,0-2.2,2.19v15.3A2.19,2.19,0,0,0,6.11,26H21.55a2.19,2.19,0,0,0,2.2-2.19V16.16"}),(0,i.jsx)("path",{className:"svg-icn",strokeWidth:n,d:"M22.1,4.68a2.35,2.35,0,0,1,3.31,0,2.31,2.31,0,0,1,0,3.28L14.93,18.35l-4.41,1.09,1.11-4.37Z"})]})}},3312:(t,e,s)=>{s.d(e,{Z:()=>n});var i=s(5893);function n(t){var e=t.size,s=void 0===e?15:e,n=t.stroke,l=void 0===n?2:n;return(0,i.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 30 30",children:[(0,i.jsx)("polyline",{className:"svg-icn",points:"4 7.68 6.44 7.68 26 7.68"}),(0,i.jsx)("path",{className:"svg-icn",strokeWidth:l,d:"M23.56,7.68V24.76a2.45,2.45,0,0,1-2.45,2.44H8.89a2.45,2.45,0,0,1-2.45-2.44V7.68m3.67,0V5.24A2.45,2.45,0,0,1,12.56,2.8h4.88a2.45,2.45,0,0,1,2.45,2.44V7.68"}),(0,i.jsx)("line",{className:"svg-icn",strokeWidth:l,x1:"12.56",y1:"13.78",x2:"12.56",y2:"21.1"}),(0,i.jsx)("line",{className:"svg-icn",strokeWidth:l,x1:"17.44",y1:"13.78",x2:"17.44",y2:"21.1"})]})}},1252:(t,e,s)=>{s.r(e),s.d(e,{default:()=>k});var i=s(7294),n=s(5256),l=s(7462),r=s(8172),o=s(160),a=s(3727),c=s(2804),d=s(4017),u=s(2718),h=s(523),m=s(3312),x=s(9492),b=s(2249),f=s(5637),p=s(9348),j=s(4401),v=s(4735),w=s(5893);function _(t){var e=t.formID,s=(0,c.FV)(d.u),_=s[0],y=s[1],g=(0,i.useState)({show:!1}),N=g[0],k=g[1],Z=(0,n.$B)().url,C=function(){N.show=!1,k((0,l.Z)({},N))},D=function(t,s){N.btnTxt=(0,f.__)("Delete","bitform"),N.body=(0,f.__)("Are you sure to delete this template","bitform"),N.btnClass="",N.action=function(){!function(t,s){if(s.original.id){var i=(0,x.Z)({formID:e,id:s.original.id},"bitforms_delete_mailtemplate").then((function(e){if(void 0!==e&&e.success){var s=(0,b.p$)(_);s.splice(t,1),y(s)}}));o.ZP.promise(i,{loading:"Deleting",success:"Successfully Deleted",error:"Error Occurred"})}else{var n=(0,b.p$)(_);n.splice(t,1),y(n)}}(t,s),C()},N.show=!0,k((0,l.Z)({},N))},T=function(t){N.btnTxt=(0,f.__)("Duplicate","bitform"),N.body=(0,f.__)("Are you sure to duplicate this template?","bitform"),N.btnClass="blue",N.action=function(){!function(t){var e=(0,r.ZP)(_,(function(e){e.splice(t+1,0,{title:e[t].title,sub:e[t].sub,body:e[t].body}),e.push({updateTem:1})}));y(e)}(t),C()},N.show=!0,k((0,l.Z)({},N))},A=[{Header:(0,f.__)("Template Name","bitform"),accessor:"title",Cell:function(t){return(0,w.jsx)(a.OL,{to:Z+"/"+t.row.index,children:(0,w.jsx)("b",{children:t.cell.value})})}},{Header:(0,f.__)("Action","bitform"),accessor:"action",Cell:function(t){return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(p.Z,{onClick:function(){return T(t.row.index)},className:"icn-btn mr-2 tooltip pos-rel",style:{"--tooltip-txt":"'"+(0,f.__)("Duplicate","bitform")+"'"},children:(0,w.jsx)(u.Z,{size:"22"})}),(0,w.jsx)(a.OL,{to:Z+"/"+t.row.index,className:"icn-btn mr-2 flx flx-center tooltip pos-rel",style:{"--tooltip-txt":"'"+(0,f.__)("Edit","bitform")+"'"},children:(0,w.jsx)(h.Z,{size:"22"})}),(0,w.jsx)(p.Z,{onClick:function(){return D(t.row.index,t.row)},className:"icn-btn tooltip pos-rel",style:{"--tooltip-txt":"'"+(0,f.__)("Delete","bitform")+"'"},children:(0,w.jsx)(m.Z,{size:"21"})})]})}}];return(0,w.jsxs)("div",{className:"w-7",children:[(0,w.jsx)(j.Z,{show:N.show,close:C,btnTxt:N.btnTxt,btnClass:N.btnClass,body:N.body,action:N.action}),(0,w.jsx)("h2",{children:(0,f.__)("Email Templates","bitform")}),(0,w.jsxs)("h5",{children:["How to setup Email Templates & Send Email Notification: ",(0,w.jsx)("a",{href:"https://youtu.be/HpMUF5EO-Gg",target:"_blank",rel:"noreferrer",style:{color:"red"},children:"YouTube"})]}),(0,w.jsxs)("div",{className:"",children:[(0,w.jsxs)(a.rU,{to:Z+"/new",className:"btn blue",children:[(0,w.jsx)("span",{className:"btcd-icn icn-layout"})," ",(0,f.__)("Add New Template","bitform")]}),_.length>0?(0,w.jsx)(v.Z,{height:"60vh",className:"btcd-neu-table mr-1",columns:A,data:_}):(0,w.jsxs)("div",{className:"txt-center btcd-empty",children:[(0,w.jsx)("span",{className:"btcd-icn icn-stack"}),(0,f.__)("Empty","bitform")]})]})]})}var y=s(6701),g=(0,i.lazy)((function(){return s.e(3523).then(s.bind(s,3523))})),N=(0,i.lazy)((function(){return s.e(4524).then(s.bind(s,4524))}));function k(t){var e=t.formID,s=(0,n.$B)().path;return(0,w.jsxs)(n.rs,{children:[(0,w.jsx)(n.AW,{exact:!0,path:s,children:(0,w.jsx)(_,{formID:e})}),(0,w.jsx)(n.AW,{path:s+"/new",children:(0,w.jsx)(i.Suspense,{fallback:(0,w.jsx)(y.Z,{}),children:(0,w.jsx)(g,{})})}),(0,w.jsx)(n.AW,{path:s+"/:id",children:(0,w.jsx)(i.Suspense,{fallback:(0,w.jsx)(y.Z,{}),children:(0,w.jsx)(N,{})})})]})}},9348:(t,e,s)=>{s.d(e,{Z:()=>n});var i=s(5893);const n=function(t){var e=t.className,s=t.type,n=t.onClick,l=t.icn,r=t.children,o=t.style;return(0,i.jsx)("button",{style:o,className:(l?"icn-btn":"btn")+" "+e,type:s||"button",onClick:n,"aria-label":"btcd-button",children:r})}}}]); |