ocearo-ui
Version:
Ocean Robot UI: 3D visualization dashboard for signalk
1 lines • 1.4 kB
JavaScript
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,70829,e=>{"use strict";var t=e.i(43476),r=e.i(71645),l=e.i(49721),o=e.i(68757);e.s(["default",0,({path:e})=>{let[s,i]=(0,r.useState)([]),[n,a]=(0,r.useState)(null),c=(0,r.useRef)(null);return(0,r.useEffect)(()=>{(async()=>{try{let t=await fetch(`${e}/index.json`);if(!t.ok)throw Error("Network response was not ok");let r=await t.json();i(r),r.length>0&&a(r[0])}catch(e){console.error("Error fetching PDF files:",e)}})()},[e]),(0,t.jsxs)("div",{className:"flex flex-col h-full bg-rightPaneBg overflow-hidden",ref:c,children:[(0,t.jsx)("div",{className:"flex border-b border-hud bg-hud-bg overflow-x-auto scrollbar-hide",children:s.map((e,r)=>(0,t.jsxs)("button",{onClick:()=>a(e),className:`flex-1 py-3 px-2 text-xs font-black uppercase flex items-center justify-center transition-all duration-500 whitespace-nowrap ${n?.file===e.file?"text-oGreen border-b-2 border-oGreen bg-hud-bg":"text-hud-secondary hover:text-hud-main tesla-hover"}`,children:[(0,t.jsx)(l.FontAwesomeIcon,{icon:o.faFileAlt,className:"mr-2"}),e.title]},r))}),(0,t.jsx)("div",{className:"flex-grow bg-hud-bg text-hud-main flex items-center justify-center",children:n&&(0,t.jsx)("iframe",{src:`${e}/${n.file}`,title:"PDF Viewer",width:"100%",height:"100%",style:{border:"none"}})})]})}])},92094,e=>{e.n(e.i(70829))}]);