PageSourceSearch

https://adeebco-krcgguzr.manus.space/assets/OwnerUsers-DN3LW6QU.js

js adeebco-krcgguzr.manus.space collected 2026-10-03 05:00:19 UTC 5,746 bytes, 6 lines download raw bytes

1import{c as d,t as r,j as e,L as x,m as i,g as o}from"./index-C9BAOTn9.js";/**
2 * @license lucide-react v0.453.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const p=d("UserCog",[["circle",{cx:"18",cy:"15",r:"3",key:"gjjjvw"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M10 15H6a4 4 0 0 0-4 4v2",key:"1nfge6"}],["path",{d:"m21.7 16.4-.9-.3",key:"12j9ji"}],["path",{d:"m15.2 13.9-.9-.3",key:"1fdjdi"}],["path",{d:"m16.6 18.7.3-.9",key:"heedtr"}],["path",{d:"m19.1 12.2.3-.9",key:"1af3ki"}],["path",{d:"m19.6 18.7-.4-1",key:"1x9vze"}],["path",{d:"m16.8 12.3-.4-1",key:"vqeiwj"}],["path",{d:"m14.3 16.6 1-.4",key:"1qlj63"}],["path",{d:"m20.7 13.8 1-.4",key:"1v5t8k"}]]),l={user:"طالب",teacher:"معلم",admin:"مالك / إدارة"};function h(){const a=r.admin.listUsers.useQuery(),n=r.useUtils(),c=r.admin.setUserRole.useMutation({onSuccess:()=>n.admin.listUsers.invalidate()});return e.jsxs("div",{"data-loc":"client/src/pages/OwnerUsers.tsx:10",dir:"rtl",className:"min-h-screen bg-[#070a12] px-5 py-8 text-white sm:px-10",children:[e.jsxs("header",{"data-loc":"client/src/pages/OwnerUsers.tsx:10",className:"mx-auto flex max-w-6xl items-center justify-between",children:[e.jsx(x,{"data-loc":"client/src/pages/OwnerUsers.tsx:10",href:"/owner-dashboard",className:"text-sm text-slate-400 hover:text-white",children:"العودة إلى لوحة المالك"}),e.jsxs("div",{"data-loc":"client/src/pages/OwnerUsers.tsx:10",className:"flex items-center gap-3",children:[e.jsx(i,{"data-loc":"client/src/pages/OwnerUsers.tsx:10",className:"text-[#72d7ca]"}),e.jsx("p",{"data-loc":"client/src/pages/OwnerUsers.tsx:10",className:"font-display font-bold",children:"إدارة المستخدمين والأدوار"})]})]}),e.jsx("main",{"data-loc":"client/src/pages/OwnerUsers.tsx:10",className:"mx-auto mt-10 max-w-6xl",children:e.jsxs("section",{"data-loc":"client/src/pages/OwnerUsers.tsx:10",className:"rounded-[2rem] border border-[#72d7ca]/20 bg-[#0e1422] p-7",children:[e.jsx("p",{"data-loc":"client/src/pages/OwnerUsers.tsx:10",className:"text-sm text-slate-400",children:"تغيير الدور يتم عبر الخادم ولا يعتمد على localStorage. لا يمكن تغيير دور المالك الأساسي."}),e.jsxs("div",{"data-loc":"client/src/pages/OwnerUsers.tsx:10",className:"mt-7 overflow-x-auto",children:[e.jsxs("table",{"data-loc":"client/src/pages/OwnerUsers.tsx:10",className:"w-full min-w-[680px] text-right text-sm",children:[e.jsx("thead",{"data-loc":"client/src/pages/OwnerUsers.tsx:10",className:"border-b border-white/10 text-xs text-slate-500",children:e.jsxs("tr",{"data-loc":"client/src/pages/OwnerUsers.tsx:10",children:[e.jsx("th",{"data-loc":"client/src/pages/OwnerUsers.tsx:10",className:"px-3 py-3",children:"المستخدم"}),e.jsx("th",{"data-loc":"client/src/pages/OwnerUsers.tsx:10",className:"px-3 py-3",children:"البريد"}),e.jsx("th",{"data-loc":"client/src/pages/OwnerUsers.tsx:10",className:"px-3 py-3",children:"الدور"}),e.jsx("th",{"data-loc":"client/src/pages/OwnerUsers.tsx:10",className:"px-3 py-3",children:"إجراء"})]})}),e.jsx("tbody",{"data-loc":"client/src/pages/OwnerUsers.tsx:10",children:(a.data??[]).map(s=>e.jsxs("tr",{"data-loc":"client/src/pages/OwnerUsers.tsx:10",className:"border-b border-white/[0.06]",children:[e.jsxs("td",{"data-loc":"client/src/pages/OwnerUsers.tsx:10",className:"px-3 py-4",children:[e.jsx("p",{"data-loc":"client/src/pages/OwnerUsers.tsx:10",className:"font-bold",children:s.name||"بدون اسم"}),e.jsxs("p",{"data-loc":"client/src/pages/OwnerUsers.tsx:10",className:"mt-1 text-xs text-slate-500",children:["#",s.id]})]}),e.jsx("td",{"data-loc":"client/src/pages/OwnerUsers.tsx:10",className:"px-3 py-4 text-slate-400",children:s.email||"غير متاح"}),e.jsx("td",{"data-loc":"client/src/pages/OwnerUsers.tsx:10",className:"px-3 py-4",children:e.jsx("span",{"data-loc":"client/src/pages/OwnerUsers.tsx:10",className:"rounded-full bg-white/[0.06] px-3 py-1 text-xs font-bold",children:l[s.role]}
6)}),e.jsx("td",{"data-loc":"client/src/pages/OwnerUsers.tsx:10",className:"px-3 py-4",children:e.jsx("div",{"data-loc":"client/src/pages/OwnerUsers.tsx:10",className:"flex flex-wrap gap-2",children:s.role!=="admin"&&e.jsx(e.Fragment,{children:["user","teacher"].filter(t=>t!==s.role).map(t=>e.jsxs("button",{"data-loc":"client/src/pages/OwnerUsers.tsx:10",type:"button",disabled:c.isPending,onClick:()=>c.mutate({userId:s.id,role:t}),className:"inline-flex items-center gap-2 rounded-xl border border-[#72d7ca]/25 px-3 py-2 text-xs font-bold text-[#9be9df] hover:bg-[#72d7ca]/10",children:[e.jsx(p,{"data-loc":"client/src/pages/OwnerUsers.tsx:10",className:"h-3.5 w-3.5"}),"تحويل إلى ",l[t]]},t))})})})]},s.id))})]}),a.isLoading&&e.jsx("p",{"data-loc":"client/src/pages/OwnerUsers.tsx:10",className:"py-8 text-center text-sm text-slate-500",children:"جارٍ تحميل المستخدمين…"}),!a.isLoading&&!a.data?.length&&e.jsx("p",{"data-loc":"client/src/pages/OwnerUsers.tsx:10",className:"py-8 text-center text-sm text-slate-500",children:"لا توجد حسابات بعد."})]}),c.isSuccess&&e.jsxs("p",{"data-loc":"client/src/pages/OwnerUsers.tsx:10",role:"status",className:"mt-5 flex items-center gap-2 text-sm text-[#9be9df]",children:[e.jsx(o,{"data-loc":"client/src/pages/OwnerUsers.tsx:10",className:"h-4 w-4"}),"تم تحديث الدور الخادمي."]}),c.error&&e.jsx("p",{"data-loc":"client/src/pages/OwnerUsers.tsx:10",role:"alert",className:"mt-5 text-sm text-rose-300",children:"تعذر تحديث الدور. تحقق من صلاحية المالك."})]})})]})}export{h 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.