/
opt
/
canhelp
/
apps
/
web
/
.next
/
static
/
chunks
/
app
/
tasks
/
/opt/canhelp/apps/web/.next/static/chunks/app/tasks
mkdir
upload
Name
Size
Mode
Actions
new/
-
0755
rm
[id]/
-
0755
rm
page-010802e5fac84bdd.js
14902
0644
edit
dl
rm
Edit:
/opt/canhelp/apps/web/.next/static/chunks/app/tasks/page-010802e5fac84bdd.js
(14902B)
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8147],{351:(e,t,n)=>{"use strict";n.d(t,{TaskMapDynamic:()=>s});var r=n(4568);let s=(0,n(6442).default)(()=>Promise.all([n.e(2012),n.e(9031),n.e(3542),n.e(7797)]).then(n.bind(n,7797)).then(e=>e.TaskMapClient),{loadableGenerated:{webpack:()=>[7797]},ssr:!1,loading:()=>(0,r.jsx)("div",{className:"rounded-xl border border-gray-200 bg-gray-50 flex items-center justify-center",style:{height:580},children:(0,r.jsx)("div",{className:"w-8 h-8 border-2 border-green-500 border-t-transparent rounded-full animate-spin"})})})},811:(e,t,n)=>{"use strict";n.d(t,{TaskListClient:()=>d});var r=n(4568),s=n(7620),a=n(9664),l=n.n(a),i=n(9906),o=n(4962),c=n(4017),u=n(1258);function d(e){let{initialTasks:t,initialTotal:n,filterParams:a,locale:d,catMap:m,locMap:g,mode:x="all"}=e,{locale:h}=(0,i.Y)(),f=(0,o.$)(h),[b,p]=(0,s.useState)(t),[y]=(0,s.useState)(n),[j,v]=(0,s.useState)(1),[k,w]=(0,s.useState)(!1),N=b.length<y;async function _(){w(!0);try{let e=j+1,t=new URLSearchParams({...a,page:String(e),limit:"10"}),n=await fetch("".concat("https://api.canhelp.gr","/api").concat("for_me"===x?"/tasks/for-me":"/tasks","?").concat(t),{credentials:"include"}),r=await n.json();p(e=>[...e,...r.data||[]]),v(e)}finally{w(!1)}}return 0===b.length?(0,r.jsx)("div",{className:"text-center py-20 text-white/70",children:(0,r.jsx)("p",{className:"text-lg",children:f("tasks.empty")})}):(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"space-y-4",children:b.map(e=>{var t,n,s;let a=e.task||e,i=e.customer;return(0,r.jsx)(l(),{href:"/tasks/".concat(a.id),className:"block bg-white rounded-xl border border-gray-200 p-5 hover:shadow-md hover:border-green-300 transition",children:(0,r.jsxs)("div",{className:"flex justify-between items-start gap-4",children:[(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,r.jsx)("span",{className:"text-xs font-medium text-green-600 bg-green-50 px-2 py-0.5 rounded-full",children:a.category?null!=(t=m[a.category])?t:a.category:f("tasks.category.general")}),a.location&&(0,r.jsxs)("span",{className:"text-xs text-gray-500",children:["\uD83D\uDCCD ",null!=(n=g[a.location])?n:a.location]})]}),(0,r.jsx)("h2",{className:"font-semibold text-gray-900 text-lg mb-1 truncate",children:(0,c.Oj)(a,h)}),(0,r.jsx)("p",{className:"text-sm text-gray-500 line-clamp-2",children:(0,c.GZ)(a,h)})]}),(0,r.jsxs)("div",{className:"text-right shrink-0",children:[a.budget?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("p",{className:"text-lg font-bold text-green-600",children:[(0,c.$g)(a.budget),"€"]}),a.budgetNegotiable&&(0,r.jsx)("p",{className:"text-xs text-green-600",children:f("task.budget_negotiable")})]}):a.budgetNegotiable?(0,r.jsx)("p",{className:"text-sm font-medium text-green-600",children:f("task.budget_negotiable")}):null,(0,r.jsxs)("p",{className:"text-xs text-gray-600 mt-1",children:[(0,r.jsxs)("span",{className:"text-gray-500",children:[a.deadline?f("task.deadline"):f("task.created_at"),": "]}),new Date(null!=(s=a.deadline)?s:a.createdAt).toLocaleDateString("ru"===h?"ru-RU":"en"===h?"en-US":"el-GR")]}),i&&(0,r.jsxs)("div",{className:"flex items-center justify-end gap-1.5 mt-2",children:[(0,r.jsxs)("div",{className:"text-right",children:[(0,r.jsx)("p",{className:"text-xs text-gray-500 leading-none",children:(0,u.E)(i.name)}),i.rating&&(0,r.jsxs)("p",{className:"text-xs text-yellow-500 leading-none mt-0.5",children:["★ ",Number(i.rating).toFixed(1)]})]}),(0,r.jsx)("div",{className:"w-7 h-7 rounded-full overflow-hidden bg-green-100 shrink-0 flex items-center justify-center",children:i.image?(0,r.jsx)("img",{src:i.image,alt:(0,u.E)(i.name),className:"w-full h-full object-cover"}):(0,r.jsx)("span",{className:"text-green-600 font-semibold text-xs",children:(0,u.E)(i.name).charAt(0).toUpperCase()})})]})]})]})},a.id)})}),N&&(0,r.jsx)("div",{className:"flex justify-center mt-8",children:(0,r.jsx)("button",{onClick:_,disabled:k,className:"px-6 py-2.5 bg-white border border-gray-300 rounded-lg text-sm font-medium text-gray-700 hover:border-green-400 hover:text-green-600 disabled:opacity-50 transition",children:k?f("common.loading"):f("tasks.load_more")})})]})}},1258:(e,t,n)=>{"use strict";function r(e){if(!(null==e?void 0:e.trim()))return"—";let t=e.trim().split(/\s+/);return t.length<2||!t[1]?t[0]:"".concat(t[0]," ").concat(t[1][0].toUpperCase(),".")}function s(e,t,n){if(null==e?void 0:e.trim()){let n=null==t?void 0:t.trim();return n?"".concat(e.trim()," ").concat(n[0].toUpperCase(),"."):e.trim()}return r(n)}n.d(t,{E:()=>r,H:()=>s})},1402:(e,t,n)=>{"use strict";function r(){return null}n.d(t,{TasksAuthGuard:()=>r})},2822:(e,t,n)=>{"use strict";n.d(t,{TaskFiltersClient:()=>c});var r=n(4568),s=n(7620),a=n(7541),l=n(9906),i=n(2818),o=n(3119);function c(e){let{categories:t,locationTree:n,budgetRange:c,initialMode:u,initialQ:d,initialCategory:m,initialLocation:g,initialBudgetMin:x,initialBudgetMax:h}=e,f=(0,a.useRouter)(),b=(0,a.usePathname)(),{t:p,locale:y}=(0,l.Y)(),[j,v]=(0,s.useState)(u),[k,w]=(0,s.useState)(null!=d?d:""),[N,_]=(0,s.useState)(null!=m?m:""),[P,S]=(0,s.useState)(null!=g?g:""),C=!!(d||m||g||x||h);function M(e){let t={mode:"for_me"===j?void 0:"all",q:k||void 0,category:N||void 0,location:P||void 0,budgetMin:x||void 0,budgetMax:h||void 0,...e},n=new URLSearchParams;for(let[e,r]of Object.entries(t))r&&n.set(e,r);return"".concat(b).concat(n.toString()?"?"+n.toString():"")}function L(e){v(e),_(""),f.push(M({mode:"for_me"===e?void 0:"all",category:void 0}))}let O=p("find_tasks.for_me"),E=p("find_tasks.all"),R=p("create.field.location.any"),T=p("create.field.location.all"),A=p("filter.category.all");return(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex gap-1 bg-gray-100 p-1 rounded-xl mb-5",children:[(0,r.jsx)("button",{type:"button",onClick:()=>L("for_me"),className:"flex-1 px-3 py-2 rounded-lg text-sm font-medium transition ".concat("for_me"===j?"bg-white text-green-600 shadow-sm":"text-gray-600 hover:text-gray-900"),children:O}),(0,r.jsx)("button",{type:"button",onClick:()=>L("all"),className:"flex-1 px-3 py-2 rounded-lg text-sm font-medium transition ".concat("all"===j?"bg-white text-green-600 shadow-sm":"text-gray-600 hover:text-gray-900"),children:E})]}),(0,r.jsxs)("form",{onSubmit:function(e){e.preventDefault();let t=new FormData(e.currentTarget),n=t.get("budgetMin")||void 0,r=t.get("budgetMax")||void 0;f.push(M({budgetMin:n,budgetMax:r}))},className:"space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:p("tasks.search")}),(0,r.jsx)("input",{name:"q",value:k,onChange:e=>w(e.target.value),placeholder:p("tasks.search.placeholder"),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]}),"all"===j&&t.length>0&&(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:p("create.field.category")}),(0,r.jsx)(i.W,{categories:t,locale:"en"===y?"en":"ru"===y?"ru":"uk"===y?"uk":"el",value:N,onChange:function(e){_(e),f.push(M({category:e||void 0}))},placeholder:A})]}),n.length>0&&(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:p("create.field.location")}),(0,r.jsx)(o.V,{locations:n,value:P,onChange:function(e){S(e),f.push(M({location:e||void 0}))},anyLabel:R,allLabel:T})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:p("tasks.field.budget")}),c.max>0&&(0,r.jsxs)("p",{className:"text-xs text-gray-400 mb-2",children:[p("tasks.budget.range")," ",c.min,"€ — ",c.max,"€"]}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("input",{name:"budgetMin",type:"number",min:0,defaultValue:x,placeholder:c.min?String(c.min):p("tasks.budget.from"),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"}),(0,r.jsx)("span",{className:"text-gray-400 shrink-0",children:"—"}),(0,r.jsx)("input",{name:"budgetMax",type:"number",min:0,defaultValue:h,placeholder:c.max?String(c.max):p("tasks.budget.to"),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]})]}),(0,r.jsx)("button",{type:"submit",className:"w-full bg-green-600 text-white py-2 rounded-lg text-sm font-medium hover:bg-green-700",children:p("tasks.search.btn")}),C&&(0,r.jsxs)("button",{type:"button",onClick:function(){w(""),_(""),S(""),f.push("for_me"===j?"/tasks":"/tasks?mode=all")},className:"w-full flex items-center justify-center gap-1.5 py-2 rounded-lg text-sm font-medium text-gray-500 hover:text-gray-700 hover:bg-gray-50 border border-gray-200 transition-colors",children:[(0,r.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})}),p("tasks.filter.reset")]})]})]})}},3042:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorage",{enumerable:!0,get:function(){return r.workAsyncStorageInstance}});let r=n(6035)},3625:(e,t,n)=>{"use strict";function r(e){let{moduleIds:t}=e;return null}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PreloadChunks",{enumerable:!0,get:function(){return r}}),n(4568),n(7509),n(3042),n(1271)},4017:(e,t,n)=>{"use strict";function r(e,t){return"el"===t&&e.titleEl?e.titleEl:"en"===t&&e.titleEn?e.titleEn:"ru"===t&&e.titleRu?e.titleRu:e.title}function s(e){return null==e||""===e?"":Math.round(Number(e)).toString()}function a(e,t){return"el"===t&&e.descriptionEl?e.descriptionEl:"en"===t&&e.descriptionEn?e.descriptionEn:"ru"===t&&e.descriptionRu?e.descriptionRu:e.description}n.d(t,{$g:()=>s,GZ:()=>a,Oj:()=>r})},5161:(e,t,n)=>{Promise.resolve().then(n.bind(n,2822)),Promise.resolve().then(n.bind(n,811)),Promise.resolve().then(n.bind(n,351)),Promise.resolve().then(n.bind(n,1402)),Promise.resolve().then(n.bind(n,6817)),Promise.resolve().then(n.t.bind(n,9664,23))},5575:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return s}});let r=n(4931)._(n(7007));function s(e,t){var n;let s={};"function"==typeof e&&(s.loader=e);let a={...s,...t};return(0,r.default)({...a,modules:null==(n=a.loadableGenerated)?void 0:n.modules})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},6035:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorageInstance",{enumerable:!0,get:function(){return r}});let r=(0,n(9113).createAsyncLocalStorage)()},6442:(e,t,n)=>{"use strict";n.d(t,{default:()=>s.a});var r=n(5575),s=n.n(r)},6452:(e,t,n)=>{"use strict";function r(e){let{reason:t,children:n}=e;return n}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BailoutToCSR",{enumerable:!0,get:function(){return r}}),n(9800)},6817:(e,t,n)=>{"use strict";n.d(t,{TaskViewToggle:()=>l});var r=n(4568),s=n(7541),a=n(9906);function l(e){let{view:t}=e,n=(0,s.useRouter)(),l=(0,s.usePathname)(),i=(0,s.useSearchParams)(),{locale:o}=(0,a.Y)(),c=e=>{let t=new URLSearchParams(i.toString());"map"===e?t.set("view","map"):t.delete("view"),t.delete("page"),n.push("".concat(l).concat(t.toString()?"?"+t.toString():""))};return(0,r.jsxs)("div",{className:"flex gap-1 bg-white/20 p-1 rounded-xl",children:[(0,r.jsxs)("button",{onClick:()=>c("list"),className:"flex items-center gap-1.5 px-4 py-1.5 rounded-lg text-sm font-medium transition ".concat("list"===t?"bg-white text-gray-900 shadow-sm":"text-white/80 hover:text-white"),children:[(0,r.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})}),"ru"===o?"Список":"en"===o?"List":"Λίστα"]}),(0,r.jsxs)("button",{onClick:()=>c("map"),className:"flex items-center gap-1.5 px-4 py-1.5 rounded-lg text-sm font-medium transition ".concat("map"===t?"bg-white text-gray-900 shadow-sm":"text-white/80 hover:text-white"),children:[(0,r.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 20l-5.447-2.724A1 1 0 013 16.382V5.618a1 1 0 011.447-.894L9 7m0 13l6-3m-6 3V7m6 10l4.553 2.276A1 1 0 0021 18.382V7.618a1 1 0 00-.553-.894L15 4m0 13V4m0 0L9 7"})}),"ru"===o?"Карта":"en"===o?"Map":"Χάρτης"]})]})}},7007:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o}});let r=n(4568),s=n(7620),a=n(6452);function l(e){return{default:e&&"default"in e?e.default:e}}n(3625);let i={loader:()=>Promise.resolve(l(()=>null)),loading:null,ssr:!0},o=function(e){let t={...i,...e},n=(0,s.lazy)(()=>t.loader().then(l)),o=t.loading;function c(e){let l=o?(0,r.jsx)(o,{isLoading:!0,pastDelay:!0,error:null}):null,i=!t.ssr||!!t.loading,c=i?s.Suspense:s.Fragment,u=t.ssr?(0,r.jsxs)(r.Fragment,{children:[null,(0,r.jsx)(n,{...e})]}):(0,r.jsx)(a.BailoutToCSR,{reason:"next/dynamic",children:(0,r.jsx)(n,{...e})});return(0,r.jsx)(c,{...i?{fallback:l}:{},children:u})}return c.displayName="LoadableComponent",c}},7541:(e,t,n)=>{"use strict";var r=n(3041);n.o(r,"useParams")&&n.d(t,{useParams:function(){return r.useParams}}),n.o(r,"usePathname")&&n.d(t,{usePathname:function(){return r.usePathname}}),n.o(r,"useRouter")&&n.d(t,{useRouter:function(){return r.useRouter}}),n.o(r,"useSearchParams")&&n.d(t,{useSearchParams:function(){return r.useSearchParams}})},9113:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{bindSnapshot:function(){return l},createAsyncLocalStorage:function(){return a},createSnapshot:function(){return i}});let n=Object.defineProperty(Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"),"__NEXT_ERROR_CODE",{value:"E504",enumerable:!1,configurable:!0});class r{disable(){throw n}getStore(){}run(){throw n}exit(){throw n}enterWith(){throw n}static bind(e){return e}}let s="undefined"!=typeof globalThis&&globalThis.AsyncLocalStorage;function a(){return s?new s:new r}function l(e){return s?s.bind(e):r.bind(e)}function i(){return s?s.snapshot():function(e,...t){return e(...t)}}}},e=>{e.O(0,[9664,9906,1530,587,18,7358],()=>e(e.s=5161)),_N_E=e.O()}]);
Save
cmd:
run