1 line
12 KiB
JavaScript
1 line
12 KiB
JavaScript
(()=>{var e={};e.id=7916,e.ids=[7916],e.modules={3295:e=>{"use strict";e.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},11723:e=>{"use strict";e.exports=require("querystring")},12412:e=>{"use strict";e.exports=require("assert")},14985:e=>{"use strict";e.exports=require("dns")},19121:e=>{"use strict";e.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:e=>{"use strict";e.exports=require("os")},23036:(e,s,t)=>{Promise.resolve().then(t.bind(t,34741))},24791:(e,s,t)=>{Promise.resolve().then(t.bind(t,80982))},27910:e=>{"use strict";e.exports=require("stream")},28354:e=>{"use strict";e.exports=require("util")},29294:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:e=>{"use strict";e.exports=require("path")},34631:e=>{"use strict";e.exports=require("tls")},34741:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>u});var r=t(60687),a=t(43210),i=t(99270),o=t(68988),n=t(85814),l=t.n(n),d=t(24934),c=t(70333);function u(){let[e,s]=(0,a.useState)(""),[t,n]=(0,a.useState)([]),[u,m]=(0,a.useState)(!0),{toast:p}=(0,c.dj)(),x=t.filter(s=>s.name.toLowerCase().includes(e.toLowerCase())||s.niveau.toLowerCase().includes(e.toLowerCase())||s.missionType.toLowerCase().includes(e.toLowerCase())||s.oddScope.some(s=>s.toLowerCase().includes(e.toLowerCase()))),h=e=>new Date(e).toLocaleDateString("fr-FR",{day:"2-digit",month:"2-digit",year:"numeric"}),g=e=>{let s=e.oddScope&&e.oddScope.length>0?e.oddScope[0]:null,t=s?s.replace("odd-",""):null;return{number:t,label:t?`ODD ${t}`:"Non cat\xe9goris\xe9",iconPath:t?`/F SDG Icons 2019 WEB/F-WEB-Goal-${t.padStart(2,"0")}.png`:""}},f=e=>{switch(e){case"a":return"bg-green-100 text-green-800";case"b":return"bg-blue-100 text-blue-800";case"c":return"bg-purple-100 text-purple-800";case"s":return"bg-amber-100 text-amber-800";default:return"bg-gray-100 text-gray-800"}},b=e=>{switch(e){case"a":return"A";case"b":return"B";case"c":return"C";case"s":return"S";default:return e.toUpperCase()}};return(0,r.jsxs)("div",{className:"flex flex-col h-full w-full bg-white",children:[(0,r.jsx)("div",{className:"bg-white border-b border-gray-100 py-3 px-6",children:(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("h1",{className:"text-gray-800 text-base font-medium",children:"G\xe9rez vos missions et opportunit\xe9s de b\xe9n\xe9volat"}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(i.A,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-gray-500"}),(0,r.jsx)(o.p,{placeholder:"Rechercher une mission...",className:"h-9 pl-9 pr-3 py-2 text-sm bg-white text-gray-800 border-gray-200 rounded-md w-60",value:e,onChange:e=>s(e.target.value)})]})]})}),(0,r.jsx)("div",{className:"flex-1 overflow-auto bg-gray-50 p-6",children:u?(0,r.jsx)("div",{className:"flex justify-center items-center h-40",children:(0,r.jsx)("div",{className:"animate-spin rounded-full h-10 w-10 border-t-2 border-b-2 border-blue-600"})}):x.length>0?(0,r.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:(console.log("All mission logos:",x.map(e=>({id:e.id,name:e.name,logo:e.logo}))),x.map(e=>{let s=g(e),t=f(e.niveau);return(0,r.jsxs)("div",{className:"bg-white shadow-sm hover:shadow-md transition-shadow duration-200 border border-gray-200 overflow-hidden h-full rounded-lg flex flex-col",children:[(0,r.jsxs)("div",{className:"px-5 pt-4 pb-3 flex justify-between items-center border-b border-gray-100",children:[(0,r.jsx)("h2",{className:"text-base font-medium text-gray-900 line-clamp-2 flex-1",children:e.name}),(0,r.jsxs)("div",{className:"flex items-center gap-2 ml-2",children:[s.number&&(0,r.jsx)("div",{className:"flex items-center bg-gray-100 p-1 rounded-md",children:(0,r.jsx)("img",{src:s.iconPath,alt:s.label,className:"w-8 h-8",onError:e=>{e.target.style.display="none"}})}),(0,r.jsx)("span",{className:`flex-shrink-0 text-sm font-bold px-2.5 py-1.5 rounded-md ${t}`,children:b(e.niveau)})]})]}),(0,r.jsx)("div",{className:"flex justify-center items-center p-6 flex-grow",children:(0,r.jsxs)("div",{className:"w-48 h-48 relative",children:[e.logo?(0,r.jsx)("img",{src:e.logo||"",alt:e.name,className:"w-full h-full object-cover rounded-md",onError:s=>{console.log("Logo failed to load:",e.logo),console.log("Full URL attempted:",e.logo),s.currentTarget.style.display="none";let t=s.currentTarget.parentElement?.querySelector(".logo-fallback");t&&(t.style.display="flex")}}):null,(0,r.jsx)("div",{className:`logo-fallback w-full h-full flex items-center justify-center bg-gray-100 rounded-md text-gray-500 text-4xl font-medium ${e.logo?"hidden":""}`,children:e.name.slice(0,2).toUpperCase()})]})}),(0,r.jsxs)("div",{className:"px-5 pb-3",children:[e.services&&e.services.length>0&&(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-sm font-medium text-gray-700 block mb-1",children:"Services:"}),(0,r.jsx)("div",{className:"flex flex-wrap gap-1.5 mb-3",children:e.services.map(e=>(0,r.jsx)("span",{className:"bg-blue-50 text-blue-700 px-2 py-1 rounded-md text-xs font-medium",children:e},e))})]}),(0,r.jsx)("div",{className:"mt-2 text-sm text-gray-600 line-clamp-2",children:e.intention?e.intention.substring(0,100)+(e.intention.length>100?"...":""):"Pas de description disponible."})]}),(0,r.jsxs)("div",{className:"mt-auto px-5 py-3 border-t border-gray-100 bg-gray-50 flex justify-between items-center",children:[(0,r.jsxs)("span",{className:"text-xs text-gray-500",children:["Cr\xe9\xe9e le ",h(e.createdAt)]}),(0,r.jsx)(l(),{href:`/missions/${e.id}`,children:(0,r.jsx)(d.$,{className:"bg-blue-600 hover:bg-blue-700 text-white text-xs px-3 py-1 h-7 rounded-md",children:"Voir d\xe9tails"})})]})]},e.id)}))}):(0,r.jsxs)("div",{className:"text-center py-16 px-6 bg-white rounded-lg border border-gray-200 shadow-sm",children:[(0,r.jsx)("div",{className:"w-16 h-16 bg-gray-100 rounded-full flex items-center justify-center mx-auto mb-4",children:(0,r.jsx)(i.A,{className:"h-8 w-8 text-gray-400"})}),(0,r.jsx)("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"Aucune mission trouv\xe9e"}),(0,r.jsx)("p",{className:"text-gray-500 mb-6 max-w-md mx-auto",children:"Cr\xe9ez votre premi\xe8re mission pour commencer \xe0 organiser vos projets et inviter des participants."}),(0,r.jsx)(l(),{href:"/missions/new",children:(0,r.jsx)(d.$,{className:"bg-blue-600 hover:bg-blue-700 text-white px-4 py-2",children:"Cr\xe9er une nouvelle mission"})})]})})]})}},41204:e=>{"use strict";e.exports=require("string_decoder")},55511:e=>{"use strict";e.exports=require("crypto")},55591:e=>{"use strict";e.exports=require("https")},61407:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>r});let r=(0,t(12907).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/alma/Documents/NeahNew/app/missions/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/alma/Documents/NeahNew/app/missions/page.tsx","default")},63033:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},64543:(e,s,t)=>{Promise.resolve().then(t.bind(t,69560))},64892:(e,s,t)=>{Promise.resolve().then(t.bind(t,61407))},69560:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>r});let r=(0,t(12907).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/alma/Documents/NeahNew/app/missions/layout.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/alma/Documents/NeahNew/app/missions/layout.tsx","default")},70333:(e,s,t)=>{"use strict";t.d(s,{dj:()=>m,oR:()=>u});var r=t(43210);let a=0,i=new Map,o=e=>{if(i.has(e))return;let s=setTimeout(()=>{i.delete(e),c({type:"REMOVE_TOAST",toastId:e})},1e6);i.set(e,s)},n=(e,s)=>{switch(s.type){case"ADD_TOAST":return{...e,toasts:[s.toast,...e.toasts].slice(0,1)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(e=>e.id===s.toast.id?{...e,...s.toast}:e)};case"DISMISS_TOAST":{let{toastId:t}=s;return t?o(t):e.toasts.forEach(e=>{o(e.id)}),{...e,toasts:e.toasts.map(e=>e.id===t||void 0===t?{...e,open:!1}:e)}}case"REMOVE_TOAST":if(void 0===s.toastId)return{...e,toasts:[]};return{...e,toasts:e.toasts.filter(e=>e.id!==s.toastId)}}},l=[],d={toasts:[]};function c(e){d=n(d,e),l.forEach(e=>{e(d)})}function u({...e}){let s=(a=(a+1)%Number.MAX_SAFE_INTEGER).toString(),t=()=>c({type:"DISMISS_TOAST",toastId:s});return c({type:"ADD_TOAST",toast:{...e,id:s,open:!0,onOpenChange:e=>{e||t()}}}),{id:s,dismiss:t,update:e=>c({type:"UPDATE_TOAST",toast:{...e,id:s}})}}function m(){let[e,s]=r.useState(d);return r.useEffect(()=>(l.push(s),()=>{let e=l.indexOf(s);e>-1&&l.splice(e,1)}),[e]),{...e,toast:u,dismiss:e=>c({type:"DISMISS_TOAST",toastId:e})}}},74075:e=>{"use strict";e.exports=require("zlib")},79428:e=>{"use strict";e.exports=require("buffer")},79551:e=>{"use strict";e.exports=require("url")},80865:(e,s,t)=>{"use strict";t.r(s),t.d(s,{GlobalError:()=>o.a,__next_app__:()=>u,pages:()=>c,routeModule:()=>m,tree:()=>d});var r=t(65239),a=t(48088),i=t(88170),o=t.n(i),n=t(30893),l={};for(let e in n)0>["default","tree","pages","GlobalError","__next_app__","routeModule"].indexOf(e)&&(l[e]=()=>n[e]);t.d(s,l);let d={children:["",{children:["missions",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(t.bind(t,61407)),"/Users/alma/Documents/NeahNew/app/missions/page.tsx"]}]},{layout:[()=>Promise.resolve().then(t.bind(t,69560)),"/Users/alma/Documents/NeahNew/app/missions/layout.tsx"]}]},{layout:[()=>Promise.resolve().then(t.bind(t,58014)),"/Users/alma/Documents/NeahNew/app/layout.tsx"],"not-found":[()=>Promise.resolve().then(t.t.bind(t,57398,23)),"next/dist/client/components/not-found-error"],forbidden:[()=>Promise.resolve().then(t.t.bind(t,89999,23)),"next/dist/client/components/forbidden-error"],unauthorized:[()=>Promise.resolve().then(t.t.bind(t,65284,23)),"next/dist/client/components/unauthorized-error"]}]}.children,c=["/Users/alma/Documents/NeahNew/app/missions/page.tsx"],u={require:t,loadChunk:()=>Promise.resolve()},m=new r.AppPageRouteModule({definition:{kind:a.RouteKind.APP_PAGE,page:"/missions/page",pathname:"/missions",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:d}})},80982:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>n});var r=t(60687);t(43210);var a=t(85814),i=t.n(a),o=t(16189);function n({children:e}){let s=(0,o.usePathname)();return(0,r.jsx)("main",{className:"w-full h-screen bg-white",children:(0,r.jsxs)("div",{className:"w-full h-full px-4 pt-12 pb-4 flex",children:[(0,r.jsxs)("div",{className:"w-[234px] min-w-[234px] bg-pink-50 border-r border-gray-100 overflow-y-auto",children:[(0,r.jsxs)("div",{className:"bg-pink-50 py-4 px-6 border-b border-pink-100",children:[(0,r.jsx)("h2",{className:"text-lg font-medium text-gray-800",children:"CAP"}),(0,r.jsx)("p",{className:"text-xs text-gray-600",children:"Centre d'Administration et de Pilotage"})]}),(0,r.jsxs)("nav",{className:"mt-4",children:[(0,r.jsx)(i(),{href:"/missions",passHref:!0,children:(0,r.jsx)("div",{className:`px-6 py-[10px] ${"/missions"===s?"bg-white":""} hover:bg-white`,children:(0,r.jsx)("span",{className:"text-sm font-normal text-gray-700",children:"Mes Missions"})})}),(0,r.jsx)(i(),{href:"/missions/new",passHref:!0,children:(0,r.jsx)("div",{className:`px-6 py-[10px] ${"/missions/new"===s?"bg-white":""} hover:bg-white`,children:(0,r.jsx)("span",{className:"text-sm font-normal text-gray-700",children:"Nouvelle Mission"})})})]})]}),(0,r.jsx)("div",{className:"flex-1 overflow-auto bg-white",children:e})]})})}},81630:e=>{"use strict";e.exports=require("http")},83997:e=>{"use strict";e.exports=require("tty")},91645:e=>{"use strict";e.exports=require("net")},94735:e=>{"use strict";e.exports=require("events")},99270:(e,s,t)=>{"use strict";t.d(s,{A:()=>r});let r=(0,t(62688).A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])}};var s=require("../../webpack-runtime.js");s.C(e);var t=e=>s(s.s=e),r=s.X(0,[4243,5419,8794,1642,6724,748,6781,5500],()=>t(80865));module.exports=r})(); |