UNPKG

@hoosei/voxweave-react

Version:

A customizable and interactive voice UI component for React applications

3 lines (2 loc) 1.73 kB
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react"),m=require("./index12.js"),w=require("./index58.js"),r=require("react/jsx-runtime"),f=({error:e})=>r.jsxs("div",{children:[r.jsx("h2",{children:"Something went wrong:"}),r.jsx("pre",{children:e.message})]}),b=({size:e,isListening:t,audioData:d,listeningColors:u,notListeningColors:c,agentStatus:x,agentAudioData:h,animation:o,containerPosition:l,isVertical:v})=>{const[a,p]=s.useState(null);if(s.useEffect(()=>{const n=j=>{console.error("Unhandled error:",j.error),p("An unexpected error occurred")};return window.addEventListener("error",n),()=>{window.removeEventListener("error",n)}},[]),a)return r.jsxs("div",{children:["Error: ",a]});if(typeof o!="string"&&o!==void 0){const n=o;return w.isAuroraAnimation(o)?r.jsxs(r.Fragment,{children:[r.jsx("div",{style:{height:l==="bottom"?e/1.8:e},className:"vox:rounded-xl"}),r.jsx("div",{className:"vox:w-full vox:h-full vox:absolute vox:bottom-0 vox:left-0",children:r.jsx(m.ErrorBoundary,{FallbackComponent:f,children:r.jsx(s.Suspense,{fallback:null,children:r.jsx(n,{size:e,isListening:t,audioData:d,agentStatus:x,agentAudioData:h,listeningColors:u,notListeningColors:c,containerPosition:l,isVertical:v,animation:o})})})})]}):r.jsx("div",{style:{width:l==="bottom"?e/1.6:e,height:l==="bottom"?e/1.8:e},children:r.jsx(m.ErrorBoundary,{FallbackComponent:f,children:r.jsx(s.Suspense,{fallback:null,children:r.jsx(n,{size:e,isListening:t,audioData:d,agentStatus:x,agentAudioData:h,listeningColors:u,notListeningColors:c,containerPosition:l,isVertical:v,animation:o})})})})}};exports.VoxweaveThreeJS=b;exports.default=b; //# sourceMappingURL=index57.js.map