PageSourceSearch

https://hintermoos.at/assets/Attachment-BTWnn-5X.js

js hintermoos.at collected 2026-10-09 22:01:44 UTC 1,940 bytes, 1 lines download raw bytes

1import{E as g,a as w,r as i,s as N,j as e,B as m,m as v}from"./index-MoAbC8_9.js";import{A as U}from"./arrow-left-CZKmX_Y-.js";import{D as f}from"./download-DXQgHLv7.js";const R=()=>{const x=g(),h=w(),r=decodeURIComponent(x["*"]||""),t=r.split("/").pop()||"soubor",[s,p]=i.useState(null),[d,l]=i.useState(null);i.useEffect(()=>{let a=null,n=!1;return(async()=>{if(!r){l("missing");return}const{data:o,error:j}=await N.storage.from("forum-attachments").createSignedUrl(r,60*10);if(!n){if(j||!(o!=null&&o.signedUrl)){l("denied");return}try{const c=await fetch(o.signedUrl);if(!c.ok)throw new Error(String(c.status));const b=await c.blob();if(n)return;a=URL.createObjectURL(b),p(a)}catch{n||l("failed")}}})(),()=>{n=!0,a&&URL.revokeObjectURL(a)}},[r]);const u=/\.(pdf|png|jpe?g|gif|webp|svg)$/i.test(t);return e.jsxs("div",{className:"min-h-screen flex flex-col bg-background",children:[e.jsxs("header",{className:"flex items-center gap-3 border-b px-4 py-3",children:[e.jsxs(m,{variant:"ghost",size:"sm",onClick:()=>h(-1),children:[e.jsx(U,{className:"h-4 w-4 mr-1"}),"Zpět"]}),e.jsx("span",{className:"truncate text-sm font-medium",children:t}),s&&e.jsx("a",{href:s,download:t,className:"ml-auto",children:e.jsxs(m,{variant:"outline",size:"sm",children:[e.jsx(f,{className:"h-4 w-4 mr-1"}),"Stáhnout"]})})]}),e.jsxs("main",{className:"flex-1",children:[d&&e.jsx("div",{className:"p-8 text-center text-sm text-muted-foreground",children:"Soubor se nepodařilo načíst nebo k němu nemáte přístup."}),!d&&!s&&e.jsx("div",{className:"p-8 flex items-center justify-center text-muted-foreground",children:e.jsx(v,{className:"h-5 w-5 animate-spin"})}),s&&u&&e.jsx("iframe",{src:s,title:t,className:"w-full h-[calc(100vh-57px)] border-0"}),s&&!u&&e.jsx("div",{className:"p-8 text-center",children:e.jsx("a",{href:s,download:t,children:e.jsxs(m,{children:[e.jsx(f,{className:"h-4 w-4 mr-2"}),"Stáhnout ",t]})})})]})]})};export{R as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.