Files
docker-invoiceninja/docker/app/public/bundle.8c449823.js
2024-10-19 18:17:42 +00:00

10 lines
2.0 KiB
JavaScript

import{bC as r,u as N,a6 as b,z as C,f as y,p as g,j as e,s as l,c as a,ac as w,bD as $,h as j,bE as E,bF as B,m as k,J as D,r as S,e as _,ba as F}from"./bundle.9b7ffc79.js";const I=r.div`
&:hover {
background-color: ${n=>n.theme.hoverColor};
}
`,R=r.div`
&:hover {
background-color: ${n=>n.theme.hoverColor};
}
`;function z(n){const[o]=N(),d=b(),c=C(),{dateFormat:m}=y(),{emailRecord:t,index:h,withBottomBorder:u,withEntityNavigationIcon:p}=n,[i,v]=g.useState(!!h),x=s=>{S("POST",_("/api/v1/reactivate_email/:id",{id:s})).then(()=>F.success("reactivated_email"))};return e("div",{className:l("flex flex-col",{"border-b":u}),style:{borderColor:c.$5,color:c.$3,colorScheme:c.$0},children:[e(I,{className:l("flex justify-between px-3 py-3",n.className,{"cursor-pointer":!!t.events.length}),theme:{hoverColor:c.$4},onClick:()=>!!t.events.length&&v(s=>!s),children:[e("div",{className:"flex flex-col flex-1 min-w-0 space-y-2 pr-5",children:[e("div",{className:"flex items-center space-x-3",children:[a("span",{className:"text-sm font-medium truncate",children:t.subject}),p&&a("div",{children:a(w,{className:"cursor-pointer",element:$,size:20,onClick:()=>d(j("/:entity/:id/edit",{id:t.entity_id,entity:`${t.entity}s`}))})})]}),e("span",{className:"text-sm truncate",children:[o("to"),": ",t.recipients]})]}),!!t.events.length&&e("div",{className:"flex items-center",children:[i&&a(E,{}),!i&&a(B,{})]})]}),a("div",{className:l({hidden:i}),children:t.events.map((s,f)=>e(R,{className:"flex flex-col flex-1 min-w-0 space-y-4 px-6 py-2",theme:{hoverColor:c.$4},children:[e("div",{className:"flex justify-between space-x-2",children:[e("span",{className:"text-sm truncate",children:[o("status"),": ",s.status]}),a("span",{className:"text-sm",children:k(s.date,m)})]}),e("div",{className:"flex space-x-2 justify-between",children:[a("span",{className:"text-sm truncate",children:s.recipient}),s.bounce_id&&a(D,{behavior:"button",type:"minimal",onClick:()=>x(s.bounce_id),children:o("reactivate")})]})]},f))})]})}export{z as E};