PageSourceSearch

https://app.coachup.ai/SchoolAdminLayout.D-Nn_2gr.js

js coachup.ai collected 2026-10-05 15:18:11 UTC 8,771 bytes, 1 lines download raw bytes

1import{j as e}from"./vendor-ui.CJfDejH6.js";import{h as s,u as a,r as l,O as t}from"./vendor-react.C7jmPDBD.js";import{u as r,bT as i,bS as n,bc as c,bO as o,X as d,c7 as x,c6 as m,U as h,Y as b,aU as g}from"./page-trainee-details.BXSa36mN.js";import{s as u}from"./dashboard-trainee.Dz9TE-An.js";import{g as j}from"./logoutRedirectUtils.BwY1Up5n.js";import{k as p}from"./dashboard-trainer.D3Qwlg3F.js";import"./vendor-firebase.D5mq9z_y.js";import"./vendor-charts.Dev3jzOU.js";import"./vendor-utils.BV3OAVt1.js";import"./page-school-marketing.Bjp8oAF_.js";const y=()=>{var y,f,N;const{user:v,multiRoleData:w,signOut:k}=r(),_=s(),C=a(),[S,O]=l.useState(!1),[z,E]=l.useState(!1),[I,U]=l.useState({displayName:"",email:""});l.useEffect(()=>{(async()=>{if(null==v?void 0:v.uid)try{const e=await p.getUserProfile(v.uid,v.email);e.success&&e.data?U({displayName:e.data.displayName||v.name||"",email:e.data.email||v.email||""}):U({displayName:v.name||"",email:v.email||""})}catch(e){U({displayName:v.name||"",email:v.email||""})}})()},[v]);const P=C.pathname.split("/")[2]||"dashboard";l.useEffect(()=>{"school_admin"===(null==v?void 0:v.role)?u("school_admin"):"marketing_manager"===(null==v?void 0:v.role)&&u("marketing_manager")},[v]);const R=()=>{O(!S)},A=e=>{_(e),window.innerWidth<768&&O(!1)},D="marketing_manager"===(null==v?void 0:v.role)||"school_admin"===(null==v?void 0:v.role)&&(null==(f=null==(y=null==w?void 0:w.rolePermissions)?void 0:y[v.role])?void 0:f.includes("manage_marketing"))||(null==(N=null==w?void 0:w.availableRoles)?void 0:N.includes("marketing_manager"));return e.jsxs("div",{dir:"rtl",className:"flex flex-col min-h-screen bg-gray-50",children:[e.jsx("header",{className:"bg-white border-b border-gray-200 py-3 px-4 md:px-6",children:e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx("button",{className:"md:hidden ml-2 text-gray-500",onClick:R,children:e.jsx(i,{className:"h-6 w-6"})}),e.jsxs("div",{className:"flex items-center space-x-reverse space-x-2",children:[e.jsx(n,{className:"h-8 w-8 text-teal-500"}),e.jsx("h1",{className:"text-xl font-bold text-gray-800 hidden sm:block",children:"ניהול בית ספר"}),e.jsx("h1",{className:"text-xl font-bold text-gray-800 sm:hidden",children:"ניהול"})]})]}),e.jsxs("div",{className:"flex items-center space-x-reverse space-x-3",children:[e.jsxs("button",{className:"text-gray-500 relative",children:[e.jsx(c,{className:"h-5 w-5"}),e.jsx("span",{className:"absolute -top-1 -left-1 h-4 w-4 bg-red-500 rounded-full text-white text-xs flex items-center justify-center",children:"2"})]}),e.jsxs("div",{className:"relative",children:[e.jsxs("button",{onClick:()=>{E(!z)},className:"flex items-center space-x-reverse space-x-2 focus:outline-none",children:[e.jsx("div",{className:"h-8 w-8 rounded-full bg-teal-100 flex items-center justify-center text-teal-700 font-medium",children:I.displayName?I.displayName.charAt(0):"מ"}),e.jsx("span",{className:"font-medium text-gray-700 hidden sm:inline",children:I.displayName||(null==v?void 0:v.name)||"מנהל"}),e.jsx(o,{className:"h-4 w-4 text-gray-500 hidden sm:block"})]}),z&&e.jsxs("div",{className:"absolute left-0 mt-2 w-48 bg-white rounded-md shadow-lg py-1 z-50 border border-gray-200",children:[e.jsxs("div",{className:"px-4 py-2 text-sm text-gray-700 border-b border-gray-100",children:[e.jsx("div",{className:"font-medium",children:I.displayName||(null==v?void 0:v.name)||"מנהל"}),e.jsx("div",{className:"text-sm text-gray-500 truncate",children:I.email||(null==v?void 0:v.email)})]}),e.jsx("button",{onClick:()=>A("/school/profile"),className:"block w-full text-right px-4 py-2 text-sm text-gray-700 hover:bg-gray-100",children:"הפרופיל שלך"}),e.jsx("button",{onClick:()=>A("/school/settings"),className:"block w-full text-right px-4 py-2 text-sm text-gray-700 hover:bg-gray-100",children:"הגדרות"}),e.jsx("button",{onClick:async()=>{try{const e=j(v);sessionStorage.setItem("__app_logout_redirect__",e);const s=["__app_logout_redirect__"];
1Object.keys(localStorage).forEach(e=>{s.includes(e)||localStorage.removeItem(e)});Object.keys(sessionStorage).forEach(e=>{s.includes(e)||sessionStorage.removeItem(e)}),"caches"in window&&caches.keys().then(e=>Promise.all(e.map(e=>caches.delete(e)))).catch(e=>{}),await k()}catch(e){const s="/auth/school/login";sessionStorage.setItem("__app_logout_redirect__",s),_(s)}},className:"block w-full text-right px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 border-t border-gray-100",children:"התנתק"})]})]})]})]})}),e.jsxs("div",{className:"flex flex-1 relative",children:[S&&e.jsx("div",{className:"fixed inset-0 bg-gray-600 bg-opacity-50 z-20 md:hidden",onClick:R}),e.jsxs("aside",{className:(S?"translate-x-0":"translate-x-full")+" md:translate-x-0 transition-transform duration-300 ease-in-out fixed md:static inset-y-0 right-0 z-30 w-64 bg-white border-l border-gray-200 overflow-y-auto",children:[e.jsxs("div",{className:"flex justify-between items-center px-4 py-3 md:hidden",children:[e.jsx("button",{onClick:R,children:e.jsx(d,{className:"h-6 w-6 text-gray-500"})}),e.jsxs("div",{className:"flex items-center space-x-reverse space-x-2",children:[e.jsx(n,{className:"h-6 w-6 text-teal-500"}),e.jsx("span",{className:"font-bold text-gray-800",children:"ניהול בית ספר"})]})]}),e.jsx("nav",{className:"mt-6",children:e.jsxs("ul",{children:[e.jsx("li",{children:e.jsxs("button",{onClick:()=>A("/school/dashboard"),className:"flex items-center w-full px-6 py-3 "+("dashboard"===P?"bg-teal-50 text-teal-600 border-l-4 border-teal-500":"text-gray-600 hover:bg-gray-50"),children:[e.jsx(x,{className:"h-5 w-5 ml-3"}),e.jsx("span",{children:"סקירה כללית"})]})}),e.jsx("li",{children:e.jsxs("button",{onClick:()=>A("/school/trainers"),className:"flex items-center w-full px-6 py-3 "+("trainers"===P?"bg-teal-50 text-teal-600 border-l-4 border-teal-500":"text-gray-600 hover:bg-gray-50"),children:[e.jsx(m,{className:"h-5 w-5 ml-3"}),e.jsx("span",{children:"מאמנים"})]})}),e.jsx("li",{children:e.jsxs("button",{onClick:()=>A("/school/trainees"),className:"flex items-center w-full px-6 py-3 "+("trainees"===P?"bg-teal-50 text-teal-600 border-l-4 border-teal-500":"text-gray-600 hover:bg-gray-50"),children:[e.jsx(h,{className:"h-5 w-5 ml-3"}),e.jsx("span",{children:"מתאמנים"})]})}),D&&e.jsx("li",{children:e.jsxs("button",{onClick:()=>A("/school/marketing"),className:"flex items-center w-full px-6 py-3 "+("marketing"===P?"bg-teal-50 text-teal-600 border-l-4 border-teal-500":"text-gray-600 hover:bg-gray-50"),children:[e.jsx(b,{className:"h-5 w-5 ml-3"}),e.jsx("span",{children:"שיווק"})]})}),"school_admin"===(null==v?void 0:v.role)&&e.jsx("li",{children:e.jsxs("button",{onClick:()=>A("/school/users"),className:"flex items-center w-full px-6 py-3 "+("users"===P?"bg-teal-50 text-teal-600 border-l-4 border-teal-500":"text-gray-600 hover:bg-gray-50"),children:[e.jsx(h,{className:"h-5 w-5 ml-3"}),e.jsx("span",{children:"משתמשים"})]})}),e.jsx("li",{children:e.jsxs("button",{onClick:()=>A("/school/settings"),className:"flex items-center w-full px-6 py-3 "+("settings"===P?"bg-teal-50 text-teal-600 border-l-4 border-teal-500":"text-gray-600 hover:bg-gray-50"),children:[e.jsx(g,{className:"h-5 w-5 ml-3"}),e.jsx("span",{children:"הגדרות"})]})})]})})]}),e.jsx("div",{className:"md:hidden fixed bottom-0 left-0 right-0 bg-white border-t border-gray-200 z-10",children:e.jsxs("div",{className:"flex justify-around items-center",children:[e.jsxs("button",{onClick:()=>A("/school/dashboard"),className:"flex flex-col items-center py-2 px-3 "+("dashboard"===P?"text-teal-600":"text-gray-600"),children:[e.jsx(x,{className:"h-5 w-5 mb-1"}),e.jsx("span",{className:"text-xs",children:"סקירה"})]}),e.jsxs("button",{onClick:()=>A("/school/trainers"),className:"flex flex-col items-center py-2 px-3 "+("trainers"===P?"text-teal-600":"text-gray-600"),children:[e.jsx(m,{className:"h-5 w-5 mb-1"}),e.jsx("span",{className:"text-xs",children:"מאמנים"})]}),e.jsxs("button",{onClick:()=>A("/school/trainees"),className:"flex flex-col items-center py-2 px-3 "+("trainees"===P?"text-teal-600":"text-gray-600"),children:[e.jsx(h,{className:"h-5 w-5 mb-1"}),e.jsx("span",{className:"text-xs",children:"מתאמנים"})]}
1),"school_admin"===(null==v?void 0:v.role)&&e.jsxs("button",{onClick:()=>A("/school/users"),className:"flex flex-col items-center py-2 px-3 "+("users"===P?"text-teal-600":"text-gray-600"),children:[e.jsx(h,{className:"h-5 w-5 mb-1"}),e.jsx("span",{className:"text-xs",children:"משתמשים"})]})]})}),e.jsx("main",{className:"flex-1 p-4 md:p-6 overflow-auto pb-16 md:pb-6",children:e.jsx(t,{})})]})]})};export{y 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.