PageSourceSearch

https://lidomatrip.com/_next/static/chunks/pages/admin/settings/fallback-avatars-2b483f29472d7e30.js

js lidomatrip.com collected 2026-09-25 07:11:19 UTC 5,367 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2277],{2954:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/settings/fallback-avatars",function(){return n(37407)}])},37407:function(e,t,n){"use strict";n.r(t);var a=n(47568),r=n(10253),s=n(70655),i=n(85893),l=n(67294),c=n(25675),u=n.n(c),d=n(44389),o=n(49759),f=n(84858),h=n(32474);t.default=function(){var e=(0,d.u)("/api/admin/fallback-avatars",function(e){return(0,f.SC)(e)}),t=e.data,n=e.error,c=e.isLoading,x=e.mutate,p=(0,l.useRef)(null),m=(0,r.Z)((0,l.useState)(""),2),g=m[0],b=m[1],j=(0,r.Z)((0,l.useState)(!1),2),v=j[0],N=j[1],w=(0,r.Z)((0,l.useState)(null),2),y=w[0],_=w[1],k=t||[],C=k.filter(function(e){return e.isActive}).length;function F(){return(F=(0,a.Z)(function(e){var t,n;return(0,s.__generator)(this,function(a){switch(a.label){case 0:N(!0),_(null),a.label=1;case 1:return a.trys.push([1,4,5,6]),(t=new FormData).append("image",e),g.trim()&&t.append("alt",g.trim()),[4,(0,f.SC)("/api/admin/fallback-avatars",{method:"POST",body:t})];case 2:return a.sent(),b(""),p.current&&(p.current.value=""),[4,x()];case 3:return a.sent(),[3,6];case 4:return _((null==(n=a.sent())?void 0:n.message)||"بارگذاری انجام نشد"),[3,6];case 5:return N(!1),[7];case 6:return[2]}})})).apply(this,arguments)}function Z(){return(Z=(0,a.Z)(function(e){return(0,s.__generator)(this,function(t){switch(t.label){case 0:return[4,(0,f.SC)("/api/admin/fallback-avatars/".concat(e.id),{method:"PATCH",body:JSON.stringify({isActive:!e.isActive})})];case 1:return t.sent(),[4,x()];case 2:return t.sent(),[2]}})})).apply(this,arguments)}function A(){return(A=(0,a.Z)(function(e){return(0,s.__generator)(this,function(t){switch(t.label){case 0:if(!window.confirm("این تصویر حذف شود؟"))return[2];return[4,(0,f.SC)("/api/admin/fallback-avatars/".concat(e.id),{method:"DELETE"})];case 1:return t.sent(),[4,x()];case 2:return t.sent(),[2]}})})).apply(this,arguments)}return(0,i.jsxs)(o.Z,{title:"تصاویر جایگزین پروفایل",children:[(0,i.jsxs)(h.Zb,{children:[(0,i.jsxs)("div",{className:"mb-16",children:[(0,i.jsx)("p",{className:"text-14 leading-24 font-m text-black",children:"این تصاویر کجا دیده می‌شوند"}),(0,i.jsx)("p",{className:"mt-4 text-12 leading-20 font-r text-gray-6C6A7D",children:"هرجا کاربری عکس پروفایل نگذاشته باشد، یکی از این‌ها به‌جایش نشان داده می‌شود. انتخاب تصویر از روی شناسه‌ی کاربر است، پس هر کاربر همیشه همان یکی را می‌گیرد."}),(0,i.jsxs)("p",{className:"mt-8 text-12 leading-20 font-r text-gray-6C6A7D",children:[(0,i.jsx)("span",{className:"font-m text-black",children:"این‌ها روی حساب کاربر ذخیره نمی‌شوند."})," عکس پروفایل کاربر همچنان خالی می‌ماند و پیشخوانش همچنان از او می‌خواهد عکس بارگذاری کند."]})]}),(0,i.jsxs)("div",{className:"flex flex-wrap items-end gap-12 border-t-1 border-solid border-gray-F0F0F0 pt-16",children:[(0,i.jsx)(h.gN,{label:"متن جایگزین (اختیاری)",children:(0,i.jsx)(h.II,{value:g,onChange:function(e){return b(e.target.value)},placeholder:"مثلاً: کوهستان"})}),(0,i.jsxs)("div",{children:[(0,i.jsx)("input",{ref:p,type:"file",accept:"image/*",className:"hidden",onChange:function(e){var t,n=null===(t=e.target.files)||void 0===t?void 0:t[0];n&&function(e){F.apply(this,arguments)}(n)}}),(0,i.jsx)(h.zx,{disabled:v,onClick:function(){var e;return null===(e=p.current)||void 0===e?void 0:e.click()},children:v?"در حال بارگذاری…":"بارگذاری تصویر"})]}),(0,i.jsxs)("p",{className:"text-11 leading-18 font-r text-gray-959FA7",children:["تصویر مربعی و کوچک بفرستید؛ در سایت حداکثر ",46," پیکسل رندر می‌شود."]})]}),y&&(0,i.jsx)("p",{className:"mt-12 text-12 leading-20 text-error",children:y})]}),(0,i.jsxs)(h.Zb,{className:"mt-16",children:[(0,i.jsxs)("div",{className:"mb-12 flex items-center justify-between",children:[(0,i.jsx)("p",{className:"text-14 leading-24 font-m text-black",children:"تصاویر"}),(0,i.jsxs)(h.Ct,{children:[C," فعال"]})]}),c?(0,i.jsx)(h.Od,{}):n?(0,i.jsx)(h.ub,{text:"فهرست بارگذاری نشد"}):0===k.length?(0,i.jsx)(h.ub,{text:"هنوز تصویری بارگذاری نشده"}):(0,i.jsx)("ul",{className:"flex flex-wrap gap-16",children:k.map(function(e){return(0,i.jsxs)("li",{className:"flex w-[150px] flex-col items-center gap-8 rounded-12 border-1 border-solid border-gray-F0F0F0 p-12",children:[(0,i.jsx)("span",{className:"h-46 w-46 overflow-hidden rounded-full bg-gray-F8F8F8",children:(0,i.jsx)(u(),{src:e.url,alt:e.alt||"",width:46,height:46,className:"h-full w-full object-cover"})}),(0,i.jsx)("span",{className:"truncate text-11 leading-18 text-gray-6C6A7D",title:e.alt||"",children:e.alt||"—"}),(0,i.jsx)(h.ZD,{checked:e.isActive,onChange:function(){!function(e){Z.apply(this,arguments)}(e)}}),(0,i.jsx)("button",{type:"button",onClick:function(){!function(e){A.apply(this,arguments)}(e)},className:"text-11 leading-18 text-error hover:underline",children:"حذف"})]},e.id)})})]})]})}}},function(e){e.O(0,[9791,9759,9774,2888,179],function(){return e(e.s=2954)}),_N_E=e.O()}]);

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.