whoami7 - Manager
:
/
home
/
qbizpnmr
/
arif.umairtax.com
/
public
/
Upload File:
files >> /home/qbizpnmr/arif.umairtax.com/public/ClientSelector-Ba4kw69L.js
import{u as y,a as N,w as b,cp as k,p as _,j as i,cu as B,by as S,E as p,a8 as w,b2 as o,cv as $,bq as E,a$ as L,ci as R,cw as T}from"./bundle.OlIVtvc7.js";import{C as A}from"./ClientActionButtons-DC8u7uNL.js";function I(t){var h,r,f;const[a]=y(),d=N(),x=b(),u=k(),[l,m]=_.useState(),{resource:e}=t,g=n=>!!(e==null?void 0:e.invitations.find(c=>c.client_contact_id===n));return _.useEffect(()=>{e!=null&&e.client_id&&u.find(e.client_id).then(n=>m(n))},[e==null?void 0:e.client_id]),i.jsxs("div",{className:"flex flex-col space-y-4",children:[i.jsxs("div",{className:"flex flex-col justify-between space-y-0.5",style:{color:d.$3},children:[t.textOnly?i.jsxs("div",{className:"flex space-x-10",children:[i.jsx("span",{className:"text-sm font-medium",style:{color:d.$22},children:a("client")}),i.jsx("span",{className:"text-sm font-medium",children:(h=e==null?void 0:e.client)==null?void 0:h.display_name})]}):i.jsx(B,{inputLabel:a("client"),onChange:n=>t.onChange(n.id),value:e==null?void 0:e.client_id,readonly:t.readonly||!e,clearButton:!!(e!=null&&e.client_id),onClearButtonClick:()=>{m(void 0),t.onClearButtonClick()},initiallyVisible:!(e!=null&&e.client_id),errorMessage:t.errorMessage,disableWithSpinner:t.disableWithSpinner}),l&&i.jsx(A,{client:l}),!!(e!=null&&e.client_id)&&i.jsx(i.Fragment,{children:!!((r=l==null?void 0:l.locations)!=null&&r.length)&&t.onLocationChange&&i.jsx("div",{className:"pt-3",children:i.jsx(S,{leftSide:a("location"),noExternalPadding:!0,noVerticalPadding:!0,children:i.jsx(p,{value:e==null?void 0:e.location_id,onValueChange:n=>{var s;return(s=t.onLocationChange)==null?void 0:s.call(t,n)},customSelector:!0,children:l==null?void 0:l.locations.map(n=>i.jsx("option",{value:n.id,children:n.name},n.id))})})})})]}),(e==null?void 0:e.client_id)&&l&&l.contacts.length&&i.jsxs("div",{children:[!!(t.onLocationChange&&((f=l==null?void 0:l.locations)!=null&&f.length)||location)&&i.jsx(w,{className:"mb-2.5",children:a("contacts")}),i.jsx("div",{className:o("divide-y divide-dashed",{"divide-[#09090B1A]":!x.dark_mode,"divide-[#1f2e41]":x.dark_mode}),children:l.contacts.map((n,s)=>{var c,v,j;return i.jsxs("div",{className:o("flex justify-between items-center first:pt-0 pt-2",{"pb-1.5":!((c=e.invitations[0])!=null&&c.link)}),children:[i.jsxs("div",{className:"flex flex-col w-full",children:[i.jsxs("div",{className:"flex space-x-2.5 w-full",children:[i.jsx($,{id:n.id,value:n.id,checked:g(n.id),onChange:C=>t.onContactCheckboxChange(C.target.value,C.target.checked)}),i.jsxs("div",{className:o("flex truncate",{"flex-col":!((v=e.invitations[0])!=null&&v.link),"space-x-4":(j=e.invitations[0])==null?void 0:j.link}),children:[i.jsx("span",{className:"text-sm font-medium",style:{color:d.$3},children:n.first_name.length>=1?`${n.first_name} ${n.last_name}`:n.email||l.display_name}),n.first_name&&i.jsx("span",{className:"text-sm",style:{color:d.$22},children:n.email})]})]}),i.jsx("div",{className:"flex flex-col relative left-7",children:!!(e.invitations.length>=1&&e.invitations[0].link)&&i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(E,{className:"font-medium",to:`${e.invitations[0].link}?silent=true&client_hash=${l.client_hash}`,external:!0,children:a("view_in_portal")}),i.jsx(L,{width:"auto",placement:"bottom",message:a("copy_link"),withoutArrow:!0,children:i.jsx("div",{className:"mt-1.5",children:i.jsx(R,{text:e.invitations[0].link})})})]})})]}),n.is_locked&&i.jsx(T,{size:24})]},s)})})]})]})}export{I as C};
Copyright ©2021 || Defacer Indonesia