PageSourceSearch

https://ideamine.ai/assets/saved-X_ETUhQe.js

js ideamine.ai collected 2026-10-05 14:22:04 UTC 6,517 bytes, 1 lines download raw bytes

1import{r as o,n as a,t as x,w as I}from"./chunk-LFPYN7LY-Car07AU-.js";import{R}from"./RequireAuth-DUud1_Ar.js";import{c as p}from"./BookmarkSimple.es-kSddcd9k.js";import{u as C,e as $,g as A}from"./AuthContext-C31EqbjV.js";import"./IconBase.es-DFssTjHj.js";import"./utils-96ptXDTT.js";function y(r){return r?new Date(r).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):""}function E(){const{user:r,toggleSave:m,savedSet:b,toggleSaveIdea:f,savedIdeaSet:j}=C(),[h,c]=o.useState([]),[N,d]=o.useState(!0),[u,v]=o.useState("");o.useEffect(()=>{if(!(r!=null&&r.id)){d(!1);return}const e=r.id;let s=!1;return d(!0),v(""),Promise.all([$(e),A(e)]).then(([t,n])=>{if(s)return;const i=[...t.map(l=>({...l,type:"analysis"})),...n.map(l=>({...l,type:"idea"}))].sort((l,g)=>{const k=l.savedAt||l.saved_at||"";return(g.savedAt||g.saved_at||"").localeCompare(k)});c(i)}).catch(t=>{console.error("Saved fetch error:",t),s||v(t.message)}).finally(()=>{s||d(!1)}),()=>{s=!0}},[r==null?void 0:r.id]);const w=async(e,s)=>{c(t=>t.filter(n=>!(n.type==="analysis"&&n.appId===e&&n.categoryId===s))),await m(e,s)},S=async e=>{c(s=>s.filter(t=>!(t.type==="idea"&&t.ideaId===e))),await f(e)};return N?a.jsxs("div",{className:"mx-auto max-w-[900px] px-4 py-12 text-center",children:[a.jsx("div",{className:"w-8 h-8 border-2 border-white/20 border-t-blue-500 rounded-full animate-spin mx-auto mb-3"}),a.jsx("p",{className:"text-sm text-gray-400",children:"Loading saved items..."})]}):u?a.jsx("div",{className:"mx-auto max-w-[900px] px-4 py-12 text-center",children:a.jsxs("p",{className:"text-sm text-red-400",children:["Failed to load saved items: ",u]})}):a.jsxs("div",{className:"mx-auto max-w-[900px] px-2 sm:px-4 py-6 sm:py-10",children:[a.jsx("h1",{className:"text-xl font-semibold text-slate-100 mb-6",children:"Saved"}),h.length===0?a.jsxs("div",{className:"rounded-xl border border-white/10 bg-white/[0.02] px-6 py-12 text-center",children:[a.jsx(p,{size:32,className:"mx-auto mb-3 text-gray-500"}),a.jsx("p",{className:"text-sm text-gray-400",children:"No saved analyses or ideas yet. Browse categories and tap the bookmark icon to save."}),a.jsx(x,{to:"/",className:"mt-4 inline-block text-sm theme-accent-link no-underline hover:underline",children:"Browse categories"})]}):a.jsx("div",{className:"flex flex-col gap-3",children:h.map(e=>{if(e.type==="idea"){const n=j.has(String(e.ideaId));return a.jsxs("div",{className:"group relative rounded-xl border border-white/10 bg-white/[0.02] hover:bg-white/[0.04] transition-colors",children:[a.jsxs(x,{to:`/category/${e.categoryId}/idea/${e.ideaId}`,className:"block px-4 py-3 no-underline",children:[a.jsx("div",{className:"flex items-start justify-between gap-3",children:a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx("span",{className:"text-sm font-semibold text-slate-100 truncate",children:e.ideaName}),a.jsx("span",{className:"rounded-full border border-violet-400/30 bg-violet-400/10 px-1.5 py-0.5 text-[10px] text-violet-300 shrink-0",children:"Idea"}),a.jsx("span",{className:"text-[11px] text-gray-500 shrink-0",children:e.categoryName})]}),e.oneLinePitch&&a.jsx("p",{className:"text-[13px] text-gray-400 leading-relaxed mb-2 line-clamp-2",children:e.oneLinePitch}),a.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[e.vibeCodability!=null&&a.jsxs("span",{className:"pill-score-primary text-[10px]",children:["Vibe ",e.vibeCodability,"/10"]}),e.regulatoryRisk!=null&&a.jsxs("span",{className:"pill-score-secondary text-[10px]",children:["Reg ",e.regulatoryRisk,"/10"]}),e.competition!=null&&a.jsxs("span",{className:"pill-score-primary text-[10px]",children:["Comp ",e.competition,"/10"]}),e.revenueEstimate&&a.jsx("span",{className:"pill-score-revenue text-[10px]",children:e.revenueEstimate})]})]})}),a.jsxs("div",{className:"mt-2 text-[11px] text-gray-500",children:["Saved ",y(e.savedAt)]})]}),a.jsx("button",{onClick:i=>{i.preventDefault(),i.stopPropagation(),S(e.ideaId)},className:`absolute top-3 right-3 inline-flex items-center justify-center transition-colors cursor-pointer bg-transparent border-none p-1 rounded ${n?"text-amber-400 hover:text-amber-300":"text-gray-400 hover:text-amber-300"}`,"aria-label":"Remove from saved",children:a.jsx(p,{size:18,weight:n?"fill":"regular"})})]},`idea-${e.ideaId}`)}const s=`${e.appId}:${e.categoryId}`,t=b.has(s);return a.jsxs("div",{className:"group relative rounded-xl border border-white/10 bg-white/[0.02] hover:bg-white/[0.04] transition-colors",children:[a.jsxs(x,{to:`/category/${e.categoryId}/app/${e.appId}`,className:"block px-4 py-3 no-underline",children:[a.jsx("div",{className:"flex items-start justify-between gap-3",children:a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx("span",{className:"text-sm font-semibold text-slate-100 truncate",children:e.appName}),a.jsx("span",{className:"text-[11px] text-gray-500 shrink-0",children:e.categoryName})]}
1),e.oneLinePitch&&a.jsx("p",{className:"text-[13px] text-gray-400 leading-relaxed mb-2 line-clamp-2",children:e.oneLinePitch}),a.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[e.vibeCodability!=null&&a.jsxs("span",{className:"pill-score-primary text-[10px]",children:["Vibe ",e.vibeCodability,"/10"]}),e.marketSignal!=null&&a.jsxs("span",{className:"pill-score-secondary text-[10px]",children:["Signal ",e.marketSignal,"/10"]}),e.regulatoryRisk!=null&&a.jsxs("span",{className:"pill-score-secondary text-[10px]",children:["Reg ",e.regulatoryRisk,"/10"]}),e.competition!=null&&a.jsxs("span",{className:"pill-score-primary text-[10px]",children:["Comp ",e.competition,"/10"]}),e.revenueEstimate&&a.jsx("span",{className:"pill-score-revenue text-[10px]",children:e.revenueEstimate})]})]})}),a.jsxs("div",{className:"mt-2 text-[11px] text-gray-500",children:["Saved ",y(e.savedAt)]})]}),a.jsx("button",{onClick:n=>{n.preventDefault(),n.stopPropagation(),w(e.appId,e.categoryId)},className:`absolute top-3 right-3 inline-flex items-center justify-center transition-colors cursor-pointer bg-transparent border-none p-1 rounded ${t?"text-amber-400 hover:text-amber-300":"text-gray-400 hover:text-amber-300"}`,"aria-label":"Remove from saved",children:a.jsx(p,{size:18,weight:t?"fill":"regular"})})]},s)})})]})}function W(){return[{title:"Saved - IdeaMine"}]}const _=I(function(){return a.jsx(R,{children:a.jsx(E,{})})});export{_ as default,W as meta};

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.