import{t as e}from"./vendor-react-CAGJwf-T.js";import{D as t,E as n,ft as r,vt as i}from"./index-Z_bdWDpJ.js";var a=e();function o({caseId:e,size:o=`md`}){let s=n();if(s.status===`disabled`)return null;let c=()=>{s.startCall({caseId:e})},l=s.caseId===e,u=s.status===`dialling`||s.status===`on-call`||s.status===`ended`,d=o===`sm`?`h-7 px-2.5 text-[12px]`:``;return s.status===`connecting`?(0,a.jsxs)(t,{disabled:!0,className:`gap-1.5 `+d,children:[(0,a.jsx)(i,{className:`w-3.5 h-3.5 animate-spin`}),`Connecting…`]}):u&&l?(0,a.jsxs)(t,{variant:`outline`,disabled:!0,className:`gap-1.5 `+d,children:[(0,a.jsx)(r,{className:`w-3.5 h-3.5 text-emerald-500`}),s.status===`on-call`?`On call`:s.status===`ended`?`Wrap up`:`Dialling…`]}):u?(0,a.jsxs)(t,{variant:`outline`,disabled:!0,className:`gap-1.5 `+d,children:[(0,a.jsx)(r,{className:`w-3.5 h-3.5`}),`Busy elsewhere`]}):(0,a.jsxs)(t,{onClick:c,className:`gap-1.5 `+d,children:[(0,a.jsx)(r,{className:`w-3.5 h-3.5`}),`Call`]})}export{o as t};