1import{a4 as h,u as f,r as t,s as g,j as e,B as n}from"./index-CEISlULX.js";import{L as p}from"./loader-circle-C0qiwHXp.js";const j="https://vauhodpuhdnypebxfeod.supabase.co/functions/v1/taste-share";function y(){const{id:c=""}=h(),r=f(),[s,d]=t.useState(null),[l,o]=t.useState("loading"),[m,x]=t.useState(!1);return t.useEffect(()=>{g.auth.getSession().then(({data:a})=>x(!!a.session))},[]),t.useEffect(()=>{let a=!1;return(async()=>{try{const i=await fetch(`${j}?id=${encodeURIComponent(c)}&format=json`);if(!i.ok)throw new Error(String(i.status));const u=await i.json();a||(d(u),o("ok"))}catch{a||o("missing")}})(),()=>{a=!0}},[c]),t.useEffect(()=>{s&&(document.title=`${s.title} - Fyra`)},[s]),l==="loading"?e.jsx("div",{className:"min-h-[100svh] flex items-center justify-center bg-background",children:e.jsx(p,{className:"h-6 w-6 animate-spin text-primary"})}):e.jsxs("div",{className:"min-h-[100svh] bg-background flex flex-col items-center px-5 py-8",children:[e.jsx("div",{className:"text-lg font-bold tracking-tight text-primary mb-6",children:"Fyra"}),l==="missing"||!s?e.jsxs("div",{className:"text-center space-y-4 max-w-sm",children:[e.jsx("p",{className:"text-muted-foreground",children:"This taste is no longer available."}),e.jsx(n,{onClick:()=>r("/"),children:"Explore Fyra"})]}):e.jsxs("div",{className:"w-full max-w-sm space-y-5",children:[s.sharer&&e.jsxs("p",{className:"text-center text-sm text-muted-foreground",children:[s.sharer," thinks you'll like this"]}),e.jsxs("div",{className:"rounded-2xl overflow-hidden border bg-card shadow-sm",children:[e.jsx("div",{className:"aspect-[4/3] bg-muted",children:s.image&&e.jsx("img",{src:s.image,alt:s.title,className:"h-full w-full object-cover"})}),e.jsxs("div",{className:"p-4 space-y-1",children:[s.category&&e.jsx("div",{className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:s.category}),e.jsx("h1",{className:"text-xl font-bold leading-tight",children:s.title}),s.subtitle&&e.jsx("p",{className:"text-sm text-muted-foreground",children:s.subtitle})]})]}),e.jsx("div",{className:"space-y-2",children:m?e.jsx(n,{className:"w-full",onClick:()=>r("/compass"),children:"Open Fyra"}):e.jsxs(e.Fragment,{children:[e.jsx(n,{className:"w-full",onClick:()=>r("/auth"),children:"Join Fyra to save it"}),e.jsxs("p",{className:"text-center text-xs text-muted-foreground",children:["Save what you love, and find more of it, with ",s.sharer||"friends","."]})]})})]})]})}export{y 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.