PageSourceSearch

https://reading-doctor.base44.app/assets/TeacherHub-DBz757Rk.js

js reading-doctor.base44.app collected 2026-10-03 03:10:09 UTC 15,273 bytes, 1 lines download raw bytes

1import{cA as H,u as R,a as f,w as S,j as e,C as c,ai as d,G as Q,x as l,k as u,aj as C,ak as k,ag as I,aa as U,b2 as L,aZ as $,s as P,H as O,X as Z,b as x,r as N,U as D,co as G,l as V,n as A,aH as W,au as X,cp as J,bj as Y,cL as E,T as ee,p as se,q as y,bu as ae,aN as v,B as te,g as ne,F as le,h as F,I as ie,am as re,cE as ce}from"./index-CgRBJ9tn.js";import{C as de}from"./CommunicationHub-Rv2AGDVD.js";import{T as oe}from"./TeacherReferrals-BXEok7NU.js";import{s as me}from"./sanitize-D7QW7st4.js";import{a as M}from"./ShareWithTeacher-DUxFAK3d.js";import{G as xe}from"./GameAssignment-DpaimY1y.js";const he=t=>t===-1?"Pre-K":t===0?"K":`Grade ${t}`;function ge(){const{user:t}=H(),b=R(),{data:w=[],isLoading:p}=f({queryKey:["teacherShareRequests",t==null?void 0:t.email],queryFn:()=>x.entities.StudentShare.filter({teacher_email:t.email}),enabled:!!(t!=null&&t.email)}),r=w.filter(a=>a.direction==="parent"&&(a.status==="pending"||a.status==="active")),h=()=>b.invalidateQueries({queryKey:["teacherShareRequests",t==null?void 0:t.email]}),m=S({mutationFn:async a=>(await x.functions.invoke("respondParentShare",a)).data,onSuccess:()=>h()});return t?e.jsxs(c,{className:"mb-6",children:[e.jsx(C,{className:"bg-gradient-to-r from-blue-600 to-indigo-600 text-white",children:e.jsxs(k,{className:"flex items-center gap-2",children:[e.jsx(I,{className:"w-5 h-5"}),"Parent Share Requests (",r.length,")"]})}),e.jsx(d,{className:"p-6",children:p?e.jsxs("p",{className:"text-sm text-gray-500 flex items-center gap-2",children:[e.jsx(U,{className:"w-4 h-4 animate-spin"})," Loading…"]}):r.length===0?e.jsx("p",{className:"text-sm text-gray-500 text-center py-4",children:"No parent share requests yet. Parents can invite you by entering your email on their dashboard."}):e.jsx("div",{className:"space-y-4",children:r.map(a=>{var o;const n=a.progress_snapshot||{};return e.jsxs("div",{className:"rounded-lg border border-gray-200 p-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"font-semibold text-gray-900",children:[me(a.child_name)||"Unnamed",e.jsxs("span",{className:"text-gray-500 font-normal",children:[" · ",he(a.child_grade)]})]}),e.jsxs("p",{className:"text-xs text-gray-500 flex items-center gap-1 mt-1",children:[e.jsx(L,{className:"w-3 h-3"})," ",a.parent_email]}),e.jsxs("p",{className:"text-xs text-gray-500 flex items-center gap-1 mt-1",children:[e.jsx($,{className:"w-3 h-3"})," Parent wants to share: ",M(a.data_scope)]})]}),e.jsx(P,{className:a.status==="pending"?"bg-amber-100 text-amber-800 border-amber-200":"bg-green-100 text-green-800 border-green-200",variant:"outline",children:a.status==="pending"?"Waiting for you":"Sharing"})]}),a.status==="pending"?e.jsxs("div",{className:"flex gap-2 mt-3",children:[e.jsxs(l,{size:"sm",className:"bg-green-600 hover:bg-green-700",disabled:m.isPending,onClick:()=>m.mutate({share_id:a.id,action:"accept"}),children:[e.jsx(O,{className:"w-4 h-4 mr-1"}),"Accept"]}),e.jsxs(l,{size:"sm",variant:"outline",disabled:m.isPending,onClick:()=>m.mutate({share_id:a.id,action:"decline"}),children:[e.jsx(Z,{className:"w-4 h-4 mr-1"}),"Decline"]})]}):e.jsxs("div",{className:"mt-3 rounded-md bg-green-50 border border-green-100 p-3 text-xs text-gray-700",children:[e.jsxs("p",{className:"font-semibold text-green-800 mb-1",children:["Shared by parent: ",M(a.data_scope)]}),n.games_completed!==void 0&&e.jsxs("p",{children:["Games completed: ",n.games_completed," · Stars: ",n.total_stars," · Mastery: ",n.mastery_percent,"%"]}),n.reading_level_label&&e.jsxs("p",{children:["Reading level: ",n.reading_level_label]}),n.assessment&&e.jsxs("div",{className:"mt-1",children:[e.jsxs("p",{children:["Latest placement test:"," ",n.assessment.completed_date?new Date(n.assessment.completed_date).toLocaleDateString():"date not recorded"]}),n.assessment.overall_reading_level!==null&&n.assessment.overall_reading_level!==void 0&&e.jsxs("p",{children:["Assessed reading level: Grade ",n.assessment.overall_reading_level]}),((o=n.assessment.skill_gaps)==null?void 0:o.length)>0&&e.jsxs("p",{className:"mt-1",children:["Skill gaps:"," ",n.assessment.skill_gaps.map(j=>`${j.section_name} (Grade ${j.grade_level}
1)`).join(", ")]})]}),n.snapshot_at&&e.jsxs("p",{className:"text-gray-400 mt-1",children:["Updated ",new Date(n.snapshot_at).toLocaleString()]})]})]},a.id)})})})]}):e.jsx(c,{className:"mb-6",children:e.jsxs(d,{className:"p-6 text-center",children:[e.jsx(Q,{className:"w-10 h-10 text-indigo-500 mx-auto mb-3"}),e.jsx("p",{className:"font-semibold text-gray-900 mb-1",children:"Parents can now share progress with you"}),e.jsx("p",{className:"text-sm text-gray-600",children:"Sign in with your school email so parent invitations can reach you."}),e.jsx(l,{asChild:!0,className:"mt-4",children:e.jsx(u,{to:"/Login",children:"Sign In"})})]})})}function ve(){const[t,b]=N.useState(!1),[w,p]=N.useState("community"),[r,h]=N.useState({post_type:"lesson_plan",title:"",content:"",tags:[]}),m=R(),{data:a}=f({queryKey:["user"],queryFn:()=>x.auth.me()}),{data:n=[]}=f({queryKey:["communityPosts"],queryFn:()=>x.entities.TeacherCommunity.list("-created_date",50),initialData:[]}),{data:o=[]}=f({queryKey:["students"],queryFn:()=>x.entities.Student.list("-created_date"),initialData:[]}),[j,T]=N.useState(null),i=j||o[0],z=S({mutationFn:s=>x.entities.TeacherCommunity.create({...s,teacher_email:a==null?void 0:a.email,teacher_name:(a==null?void 0:a.full_name)||(a==null?void 0:a.email)||"Teacher"}),onSuccess:()=>{m.invalidateQueries(["communityPosts"]),b(!1),h({post_type:"lesson_plan",title:"",content:"",tags:[]})}}),B=S({mutationFn:s=>{const g=n.find(_=>_.id===s);return x.entities.TeacherCommunity.update(s,{upvotes:(g.upvotes||0)+1})},onSuccess:()=>m.invalidateQueries(["communityPosts"])}),K=[{key:"esl",label:"Multilingual Remediation",icon:W,desc:"Language acquisition scaffolds, visual vocabulary support, and latency-based interventions for English Language Learners.",color:"from-blue-500 to-cyan-500",link:"/ESLManagement",linkLabel:"Multilingual Dashboard"},{key:"dyslexia",label:"Dyslexia Support",icon:X,desc:"Structured literacy instruction: phonemic awareness, systematic phonics, decoding strategies, and cumulative review.",color:"from-indigo-500 to-blue-600",link:"/DyslexiaScreening",linkLabel:"Dyslexia Screening"},{key:"special_ed",label:"Special Education",icon:J,desc:"IEP-aligned goals, accommodations, multi-sensory learning, and progress monitoring for students with special needs.",color:"from-purple-500 to-violet-500",link:"/SpecialEdDashboard",linkLabel:"Special Ed Dashboard"}],q=[{value:"lesson_plan",label:"Lesson Plan",icon:te},{value:"game_strategy",label:"Game Strategy",icon:ne},{value:"success_story",label:"Success Story",icon:le},{value:"question",label:"Question",icon:F}];return e.jsx("div",{className:"min-h-screen bg-gradient-to-br from-blue-50 to-indigo-50 p-4 md:p-8",children:e.jsxs("div",{className:"max-w-5xl mx-auto",children:[e.jsx("div",{className:"flex items-center justify-between mb-8",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(D,{className:"w-8 h-8 text-indigo-600"}),e.jsx("h1",{className:"text-3xl font-bold text-gray-900",children:"Teacher Hub"})]})}),o.length===0&&e.jsx(c,{className:"mb-6 border-2 border-indigo-200 bg-gradient-to-br from-indigo-50 to-purple-50",children:e.jsxs(d,{className:"p-6 text-center",children:[e.jsx("p",{className:"text-gray-600 mb-4",children:"No student profile found on this account. Create one to unlock student tracking, interventions, and progress tools."}),e.jsx(l,{asChild:!0,className:"w-full py-6 text-base font-semibold bg-indigo-600",children:e.jsx(u,{to:"/ParentLanding#try-now",children:"Onboard a New Student"})})]})}),i&&e.jsx(c,{className:"mb-6 border-2 border-indigo-200 bg-gradient-to-br from-indigo-50 to-purple-50",children:e.jsxs(d,{className:"p-6 flex items-center justify-between flex-wrap gap-4",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-gradient-to-br from-indigo-600 to-purple-600 flex items-center justify-center",children:e.jsx(G,{className:"w-6 h-6 text-white"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"font-bold text-gray-900",children:"Gradual Release Support Cycle"}),e.jsxs("p",{className:"text-sm text-gray-600",children:["Guide ",i.name," through the gradual release cycle — assess needs, model the skill, guide practice, then monitor progress toward mastery"]})]})]}
1),e.jsx(u,{to:V("ParentDashboard"),children:e.jsxs(l,{className:"bg-gradient-to-r from-indigo-600 to-purple-600 hover:from-indigo-700 hover:to-purple-700",children:["Open Intervention Tracker",e.jsx(A,{className:"w-4 h-4 ml-2"})]})})]})}),e.jsxs("div",{className:"mb-6",children:[e.jsxs("h2",{className:"text-xl font-bold text-gray-900 mb-4 flex items-center gap-2",children:[e.jsx(G,{className:"w-5 h-5 text-indigo-600"}),"Specialized Intervention Tracks"]}),e.jsx("div",{className:"grid md:grid-cols-3 gap-4",children:K.map(s=>{const g=s.icon;return e.jsxs(c,{className:"border-2 border-gray-200 hover:border-indigo-300 hover:shadow-lg transition-all overflow-hidden",children:[e.jsx("div",{className:`h-2 bg-gradient-to-r ${s.color}`}),e.jsxs(d,{className:"p-5",children:[e.jsx("div",{className:`w-11 h-11 rounded-xl bg-gradient-to-br ${s.color} flex items-center justify-center mb-3`,children:e.jsx(g,{className:"w-5 h-5 text-white"})}),e.jsx("h3",{className:"font-bold text-gray-900 mb-1.5",children:s.label}),e.jsx("p",{className:"text-xs text-gray-600 mb-3",children:s.desc}),e.jsx(u,{to:i?`${s.link}?studentId=${i.id}`:s.link,children:e.jsxs(l,{variant:"outline",size:"sm",className:"w-full",children:[s.linkLabel,e.jsx(A,{className:"w-4 h-4 ml-2"})]})})]})]},s.key)})})]}),e.jsx(c,{className:"mb-6 border-2 border-indigo-300 bg-gradient-to-br from-indigo-50 to-purple-50",children:e.jsxs(d,{className:"p-6",children:[e.jsxs("h2",{className:"text-lg font-bold text-gray-900 mb-3 flex items-center gap-2",children:[e.jsx(Y,{className:"w-5 h-5 text-indigo-600"}),"Teacher Quick Actions"]}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-3",children:[e.jsxs(l,{onClick:()=>p("referrals"),className:"w-full py-6 text-base font-semibold bg-indigo-600 hover:bg-indigo-700",children:[e.jsx(I,{className:"w-5 h-5 mr-2"}),"Invite a Parent"]}),e.jsxs(l,{onClick:()=>p("assign"),className:"w-full py-6 text-base font-semibold bg-purple-600 hover:bg-purple-700",children:[e.jsx(E,{className:"w-5 h-5 mr-2"}),"Assign a Game or Activity"]})]})]})}),e.jsxs(ee,{value:w,onValueChange:p,className:"w-full",children:[e.jsxs(se,{className:"grid w-full grid-cols-2 md:grid-cols-4 bg-white border-2 border-gray-200 p-1 mb-6",children:[e.jsxs(y,{value:"community",className:"gap-2",children:[e.jsx(D,{className:"w-4 h-4"}),"Community"]}),e.jsxs(y,{value:"messages",className:"gap-2",children:[e.jsx(L,{className:"w-4 h-4"}),"Parent Messages"]}),e.jsxs(y,{value:"assign",className:"gap-2",children:[e.jsx(E,{className:"w-4 h-4"}),"Assign Activity"]}),e.jsxs(y,{value:"referrals",className:"gap-2",children:[e.jsx(ae,{className:"w-4 h-4"}),"Invite Parents"]})]}),e.jsxs(v,{value:"community",children:[e.jsx("div",{className:"flex justify-end mb-4",children:e.jsx(l,{onClick:()=>b(!t),className:"bg-indigo-600",children:t?"Cancel":"Share Knowledge"})}),t&&e.jsx(c,{className:"mb-6 border-2 border-indigo-300",children:e.jsxs(d,{className:"p-6 space-y-4",children:[e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2",children:q.map(s=>e.jsxs(l,{variant:r.post_type===s.value?"default":"outline",onClick:()=>h({...r,post_type:s.value}),className:"gap-2",children:[e.jsx(s.icon,{className:"w-4 h-4"}),s.label]},s.value))}),e.jsx(ie,{placeholder:"Title",value:r.title,onChange:s=>h({...r,title:s.target.value})}),e.jsx(re,{placeholder:"Share your knowledge, strategies, or questions...",value:r.content,onChange:s=>h({...r,content:s.target.value}),rows:6}),e.jsx(l,{onClick:()=>z.mutate(r),disabled:!r.title||!r.content,className:"w-full bg-indigo-600",children:"Post to Community"})]})}),e.jsx("div",{className:"space-y-4",children:n.map(s=>{const g=q.find(_=>_.value===s.post_type);return e.jsxs(c,{className:"border-2 border-gray-200 hover:border-indigo-300 transition-colors",children:[e.jsx(C,{children:e.jsx("div",{className:"flex items-start justify-between",children:e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[g&&e.jsx(g.icon,{className:"w-5 h-5 text-indigo-600"}),e.jsx(P,{variant:"outline",children:s.post_type.replace("_"," ")}),s.featured&&e.jsx(P,{className:"bg-yellow-500",children:"Featured"})]}),e.jsx(k,{className:"text-xl mb-1",children:s.title}),e.jsxs("p",{className:"text-sm text-gray-600",children:["by ",s.teacher_name," • ",new Date(s.created_date).toLocaleDateString()]})]})})}),e.jsxs(d,{children:[e.jsx("p",{className:"text-gray-700 mb-4 whitespace-pre-wrap",children:s.content}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs(l,{variant:"ghost",size:"sm",onClick:()=>B.mutate(s.id),className:"gap-2",children:[e.jsx(ce,{className:"w-4 h-4"}),s.upvotes||0]}),e.jsxs(l,{variant:"ghost",size:"sm",className:"gap-2",children:[e.jsx(F,{className:"w-4 h-4"}),s.comments_count||0]})]})]})]},s.id)})})]}),e.jsxs(v,{value:"messages",children:[o.length>1&&e.jsxs("div",{className:"mb-6",children:[e.jsx("label",{className:"text-sm font-medium text-gray-700 mb-2 block",children:"Select Student:"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:o.map(s=>e.jsxs(l,{onClick:()=>T(s),variant:(i==null?void 0:i.id)===s.id?"default":"outline",size:"sm",children:[s.name," 
1(Grade ",s.grade,")"]},s.id))})]}),i?e.jsxs(c,{className:"border-2 border-blue-200",children:[e.jsx(C,{children:e.jsxs(k,{className:"flex items-center gap-2",children:[e.jsx(L,{className:"w-5 h-5 text-blue-600"}),"Communication with Parents"]})}),e.jsx(d,{children:e.jsx(de,{student:i,isAdmin:!0})})]}):e.jsx(c,{children:e.jsxs(d,{className:"p-8 text-center",children:[e.jsx("p",{className:"text-gray-500 mb-4",children:"No students found. Students need to be created first."}),e.jsx(l,{asChild:!0,className:"w-full py-6 text-base font-semibold bg-indigo-600",children:e.jsx(u,{to:"/ParentLanding#try-now",children:"Onboard a New Student"})})]})})]}),e.jsxs(v,{value:"assign",children:[o.length>1&&e.jsxs("div",{className:"mb-6",children:[e.jsx("label",{className:"text-sm font-medium text-gray-700 mb-2 block",children:"Select Student:"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:o.map(s=>e.jsxs(l,{onClick:()=>T(s),variant:(i==null?void 0:i.id)===s.id?"default":"outline",size:"sm",children:[s.name," (Grade ",s.grade,")"]},s.id))})]}),i?e.jsx(xe,{student:i}):e.jsx(c,{children:e.jsxs(d,{className:"p-8 text-center",children:[e.jsx("p",{className:"text-gray-500 mb-4",children:"No students found. Create a student profile first so you can assign them games and activities."}),e.jsx(l,{asChild:!0,className:"w-full py-6 text-base font-semibold bg-indigo-600",children:e.jsx(u,{to:"/ParentLanding#try-now",children:"Onboard a New Student"})})]})})]}),e.jsxs(v,{value:"referrals",children:[e.jsx(ge,{}),e.jsx(oe,{})]})]})]})})}export{ve 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.