Files
s.esmaeiliandCursor d316d15335 Commit admin and user-app release builds after order and panel polish.
Includes the Dashboard CSS comment fix needed for the admin production build.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-16 23:40:39 +03:30

2 lines
2.6 KiB
JavaScript

import{P as x}from"./PageBar-C3mlO1TZ.js";import{d as f,e as l,f as r,x as n,q as i,O as P,P as S,Q as k,n as L,R as b,S as _,N as v,h,k as d,T as B,w as C,U as E,H as p,F as N,r as $,j as A,L as F,_ as V}from"./index-DfuyKmMj.js";import{S as H}from"./SectionHead-DuyW68OU.js";import{P as I}from"./ProductCard-hwNt6JR9.js";import{u as T}from"./catalogStore-CGKJKEQT.js";const j={class:"flex justify-center items-center empty"},D=f({__name:"EmptyState",props:{description:{},image:{}},setup(t){return(e,c)=>(l(),r("div",j,[n(i(P),{description:"موردی یافت نشد",image:t.image,class:"h-[200px] w-[200px] opacity-70"},null,8,["image"])]))}}),q="/assets/favoritEmpty-kbtPAdi5.svg",z=f({__name:"ScrollFetchSearch",props:{loading:{type:Boolean},flag:{type:Boolean},padding:{}},emits:["fetch"],setup(t,{emit:e}){const c=e,a=S(),s=d(null);return k(s,()=>{c("fetch")},{distance:50}),(o,u)=>(l(),r("main",{class:"flex flex-col flex-1 overflow-auto no-scrollbar w-[100vw] max-w-screen-md m-auto",style:L({paddingTop:t.padding||i(a).headerHeight+"px"}),ref_key:"scrollArea",ref:s},[b(o.$slots,"default"),n(_,{cls:"my-[10px]",spinning:t.loading,indicator:!0,tip:"درحال دریافت اطلاعات"},null,8,["spinning"]),t.flag?(l(),v(D,{key:0,image:i(q)},null,8,["image"])):h("",!0)],4))}});function G(){const t=T(),e=B({totalPages:0,productList:t.products,flag:!1});return C(()=>t.products,a=>{e.productList=a,e.flag=a.length<1}),{productsData:e,getProducts:async(a,s=!1,o=!1)=>{if(!s){a.value=o||!t.loaded;try{e.productList=await t.load(o),e.flag=e.productList.length<1}catch(u){console.log(u)}finally{a.value=!1}}}}}const M={class:"newest"},O={key:0,class:"newest__grid"},g=20,Q=f({__name:"NewestView",setup(t){const{productsData:e,getProducts:c}=G(),a=d(!1),s=d(!1),o=d(g),u=A(()=>e.productList.slice(0,o.value));E(async()=>{await c(a,!1)});const y=async()=>{if(o.value<e.productList.length){o.value+=g;return}s.value||await c(s,!1,!0)};return(R,U)=>{const w=F("container");return l(),r("div",M,[n(x,{title:"جدیدترین محصولات","back-to":"home"}),n(_,{spinning:a.value,tip:"درحال دریافت اطلاعات"},{default:p(()=>[n(z,{class:"newest__scroll",loading:s.value,flag:i(e).flag,padding:"0px",onFetch:y},{default:p(()=>[n(w,{class:"newest__body"},{default:p(()=>[n(H,{title:"تازه‌ها",subtitle:"آخرین افزوده‌های مجموعه"}),i(e).productList.length?(l(),r("div",O,[(l(!0),r(N,null,$(u.value,m=>(l(),v(I,{key:m.id,value:m},null,8,["value"]))),128))])):h("",!0)]),_:1})]),_:1},8,["loading","flag"])]),_:1},8,["spinning"])])}}}),Y=V(Q,[["__scopeId","data-v-1566f322"]]);export{Y as default};