PageSourceSearch

https://nutriai.si/assets/UGCDirectoryPage-DpG_XAzO.js

js nutriai.si collected 2026-10-02 01:09:50 UTC 5,072 bytes, 1 lines download raw bytes

1import{v as k,r as c,s as w,w as d,j as e,H as _,L as m,o as C,m as u,B as I,C as g,d as j,f as R,g as S,U as A,F as $}from"./index-CO45SbzP.js";import{B as L}from"./badge-CvUfKZJX.js";import{S as O}from"./SEOHead-iitdJhtr.js";import{S as f}from"./star-Bt3kGFXo.js";import{C as B}from"./clock-DdcvDvdw.js";import{U as E}from"./utensils-crossed-CPx0G62m.js";const H={recepti:{title:"Recepti skupnosti",desc:"Recepti, ki jih delijo uporabniki NutriAI — preverjeni z AI moderacijo.",icon:$,table:"ugc_recipes"},jedilniki:{title:"Jedilniki skupnosti",desc:"Jedilniki uporabnikov NutriAI za različne cilje — od hujšanja do mase.",icon:E,table:"ugc_meal_plans"},ocene:{title:"Ocene uporabnikov",desc:"Iskrene ocene uporabnikov NutriAI aplikacije.",icon:f,table:"ugc_reviews"}};function q({dirType:a}){const{locale:l}=k(),[s,N]=c.useState([]),[y,r]=c.useState(!0),i=H[a];c.useEffect(()=>{r(!0);const t=i.table;w.from(t).select("*").eq("status","approved").eq("locale",l).order("published_at",{ascending:!1}).limit(50).then(({data:n})=>{N(n||[]),r(!1)}).catch(()=>r(!1))},[a,l]);const b=`/skupnost/${a}`,v=l!=="sl",p=a==="ocene"&&s.length>0?{"@context":"https://schema.org","@type":"SoftwareApplication",name:"NutriAI",applicationCategory:"HealthApplication",aggregateRating:{"@type":"AggregateRating",ratingValue:(s.reduce((t,n)=>t+(n.rating||5),0)/s.length).toFixed(1),reviewCount:s.length,bestRating:5,worstRating:1},review:s.slice(0,10).map(t=>({"@type":"Review",author:{"@type":"Person",name:t.author_display_name},datePublished:t.published_at,reviewRating:{"@type":"Rating",ratingValue:t.rating,bestRating:5},name:t.title,reviewBody:t.body}))}:null,x=a!=="ocene"?{"@context":"https://schema.org","@type":"CollectionPage",name:i.title,description:i.desc,numberOfItems:s.length,mainEntity:{"@type":"ItemList",numberOfItems:s.length,itemListElement:s.slice(0,20).map((t,n)=>({"@type":"ListItem",position:n+1,name:t.title,url:`https://nutriai.si${d(l,`/skupnost/${a}/${t.slug}`)}`}))}}:null;return e.jsxs(e.Fragment,{children:[e.jsx(O,{title:`${i.title} | NutriAI`,description:i.desc,canonical:b}),v&&e.jsxs(_,{children:[e.jsx("meta",{name:"robots",content:"noindex,follow"}),e.jsx("link",{rel:"canonical",href:`https://nutriai.si/skupnost/${a}`})]}),p&&e.jsx("script",{type:"application/ld+json",children:JSON.stringify(p)}),x&&e.jsx("script",{type:"application/ld+json",children:JSON.stringify(x)}),e.jsxs("div",{className:"container max-w-4xl py-8",children:[e.jsxs(m,{to:d(l,"/"),className:"inline-flex items-center text-muted-foreground hover:text-primary mb-6",children:[e.jsx(C,{className:"w-4 h-4 mr-1"})," Domov"]}),e.jsxs(u.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx(i.icon,{className:"w-8 h-8 text-primary"}),e.jsx("h1",{className:"text-3xl font-bold tracking-tight text-foreground",children:i.title})]}),e.jsx("p",{className:"text-muted-foreground mb-8",children:i.desc})]}),y?e.jsx("div",{className:"flex justify-center py-20",children:e.jsx("div",{className:"w-6 h-6 border-2 border-primary border-t-transparent rounded-full animate-spin"})}):s.length===0?e.jsxs("div",{className:"text-center py-20",children:[e.jsx("p",{className:"text-muted-foreground text-lg",children:"Še ni vsebin. Bodi prvi!"}),e.jsx(m,{to:"/objavi",children:e.jsx(I,{className:"mt-4",children:"Objavi"})})]}):e.jsx("div",{className:"grid gap-4 sm:grid-cols-2",children:s.map(t=>{var n;return e.jsx(u.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},children:a==="ocene"?e.jsx(g,{children:e.jsxs(j,{className:"pt-6",children:[e.jsx("div",{className:"flex items-center gap-1 mb-2",children:Array.from({length:5}).map((o,h)=>e.jsx(f,{className:`w-4 h-4 ${h<t.rating?"text-yellow-500 fill-yellow-500":"text-muted-foreground/20"}`},h))}),e.jsx("p",{className:"font-semibold text-foreground",children:t.title}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:t.body}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-2",children:["— ",t.author_display_name]})]})}):e.jsx(m,{to:d(l,`/skupnost/${a}/${t.slug}`),children:e.jsxs(g,{className:"hover:border-primary/50 transition-colors h-full",children:[e.jsx(R,{children:e.jsx(S,{className:"text-lg",children:t.title})}),e.jsxs(j,{children:[e.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:t.description}),e.jsxs("div",{className:"flex items-center gap-3 mt-3 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(A,{className:"w-3 h-3"})," ",t.author_display_name]}),t.prep_time_min&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(B,{className:"w-3 h-3"})," ",t.prep_time_min+(t.cook_time_min||0)," min"]}),t.daily_calories&&e.jsxs("span",{children:[t.daily_calories," kcal"]})]}),((n=t.tags)==null?void 0:n.length)>0&&e.jsx("div",{className:"flex flex-wrap gap-1 mt-2",children:t.tags.slice(0,3).map(o=>e.jsx(L,{variant:"secondary",className:"text-xs",children:o},o))})]})]})})},t.id)})})]})]})}export{q 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.