PageSourceSearch

https://smartmentor.ai/assets/CorporateDashboard.C7FVwwQu.js

js smartmentor.ai collected 2026-10-05 16:21:20 UTC 12,816 bytes, 1 lines download raw bytes

1import{j as e}from"./vendor-ui-core.DP8knyZn.js";import{f as r,r as t}from"./vendor-react.BBoGJFYM.js";import{d as a,s as i,W as o,S as n,J as l,C as s,E as d,F as c,G as g}from"./index.CdjOtu-m.js";import{b as p}from"./vendor-utils.BlEnRQrd.js";import{g as b,bJ as m,ak as x,bK as h,q as u,an as v,bL as f,r as y}from"./vendor-icons.BjAWwE8z.js";import"./vendor-supabase.DS-aP8MZ.js";import"./vendor-ui-forms.CjLBxE3d.js";import"./vendor-ui-display.BT2Z6Vpo.js";import"./vendor-query.CfjDb5WU.js";import"./vendor-media.DY6E_qVO.js";import"./vendor-charts.RWeJ_I16.js";import"./vendor-motion.DCvbjL6b.js";const j={dark:{cardBg:"rgba(255,255,255,0.04)",cardBorder:"rgba(16,185,129,0.14)",cardHoverBg:"rgba(16,185,129,0.07)",cardHoverBorder:"rgba(16,185,129,0.30)",cardHoverShadow:"0 8px 32px rgba(16,185,129,0.12)",titleText:"rgba(255,255,255,0.92)",subText:"rgba(255,255,255,0.45)",metaText:"rgba(255,255,255,0.38)",rowBg:"rgba(255,255,255,0.04)",rowLabelText:"rgba(255,255,255,0.50)",rowValueText:"rgba(255,255,255,0.90)",sectionTitle:"rgba(255,255,255,0.80)",badgeActiveBg:"rgba(16,185,129,0.18)",badgeActiveText:"#10b981",badgeActiveBorder:"rgba(16,185,129,0.35)",badgeInactiveBg:"rgba(255,255,255,0.06)",badgeInactiveText:"rgba(255,255,255,0.40)",badgeInactiveBorder:"rgba(255,255,255,0.12)",countBadgeBg:"rgba(16,185,129,0.14)",countBadgeText:"#10b981",emptyCardBg:"rgba(255,255,255,0.03)",emptyCardBorder:"rgba(255,255,255,0.07)",emptyText:"rgba(255,255,255,0.30)",selectBg:"rgba(255,255,255,0.06)",selectBorder:"rgba(16,185,129,0.20)",selectText:"rgba(255,255,255,0.80)",divider:"rgba(255,255,255,0.06)",shimmerBase:"rgba(255,255,255,0.04)",shimmerHighlight:"rgba(255,255,255,0.07)",sectionIconActive:"rgba(16,185,129,0.85)",sectionIconInact:"rgba(255,255,255,0.30)"},light:{cardBg:"rgba(16,185,129,0.06)",cardBorder:"rgba(16,185,129,0.22)",cardHoverBg:"rgba(16,185,129,0.12)",cardHoverBorder:"rgba(16,185,129,0.45)",cardHoverShadow:"0 8px 32px rgba(16,185,129,0.18)",titleText:"rgba(255,255,255,0.96)",subText:"rgba(255,255,255,0.60)",metaText:"rgba(255,255,255,0.50)",rowBg:"rgba(255,255,255,0.08)",rowLabelText:"rgba(255,255,255,0.65)",rowValueText:"rgba(255,255,255,0.95)",sectionTitle:"rgba(255,255,255,0.90)",badgeActiveBg:"rgba(16,185,129,0.25)",badgeActiveText:"#10b981",badgeActiveBorder:"rgba(16,185,129,0.50)",badgeInactiveBg:"rgba(255,255,255,0.10)",badgeInactiveText:"rgba(255,255,255,0.55)",badgeInactiveBorder:"rgba(255,255,255,0.20)",countBadgeBg:"rgba(16,185,129,0.20)",countBadgeText:"#10b981",emptyCardBg:"rgba(255,255,255,0.05)",emptyCardBorder:"rgba(16,185,129,0.15)",emptyText:"rgba(255,255,255,0.45)",selectBg:"rgba(16,185,129,0.12)",selectBorder:"rgba(16,185,129,0.35)",selectText:"rgba(255,255,255,0.90)",divider:"rgba(16,185,129,0.18)",shimmerBase:"rgba(255,255,255,0.06)",shimmerHighlight:"rgba(255,255,255,0.10)",sectionIconActive:"#10b981",sectionIconInact:"rgba(255,255,255,0.45)"}};const w=[{value:"all",label:"All Time"},{value:"7",label:"Last 7 Days"},{value:"30",label:"Last 30 Days"},{value:"90",label:"Last 90 Days"}],B=[{key:"invited",label:"Invited",icon:e.jsx(x,{className:"h-3 w-3"}),color:"#60a5fa"},{key:"aiScreened",label:"AI Screened",icon:e.jsx(h,{className:"h-3 w-3"}),color:"#818cf8"},{key:"interviewed",label:"Interviewed",icon:e.jsx(u,{className:"h-3 w-3"}),color:"#2dd4bf"},{key:"shortlisted",label:"Shortlisted",icon:e.jsx(v,{className:"h-3 w-3"}),color:"#fbbf24"},{key:"hired",label:"Hired",icon:e.jsx(f,{className:"h-3 w-3"}),color:"#10b981"},{key:"rejected",label:"Rejected",icon:e.jsx(y,{className:"h-3 w-3"}),color:"#f87171"}],_=({p:r})=>e.jsxs("div",{style:{background:r.cardBg,border:`1px solid ${r.cardBorder}`,borderRadius:14,padding:"14px 14px 12px",display:"flex",flexDirection:"column",gap:10},children:[e.jsx("style",{children:"\n      @keyframes cd-shimmer {\n        0%   { opacity: 0.5; }\n        50%  { opacity: 1; }\n        100% { opacity: 0.5; }\n      }\n      .cd-shimmer { animation: cd-shimmer 1.5s ease-in-out infinite; }\n    "}),e.jsx("div",{className:"cd-shimmer",style:{height:13,width:"65%",borderRadius:6,background:r.shimmerHighlight}}),e.jsx("div",{className:"cd-shimmer",style:{height:10,width:"42%",borderRadius:6,background:r.shimmerBase}}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:5,marginTop:4},children:[1,2,3,4,5,6].map(t=>e.jsx("div",{className:"cd-shimmer",style:{height:22,borderRadius:7,background:r.shimmerBase}},t))})]}),S=({role:r,p:a,onClick:i})=>{const[o,n]=t.useState(!1);return e.jsxs("div",{role:"button",tabIndex:0,"aria-label":`View report for ${r.title}`,onClick:i,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),i())},onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),style:{background:o?a.cardHoverBg:a.cardBg,border:`1px solid ${o?a.cardHoverBorder:a.cardBorder}`,boxShadow:o?a.cardHoverShadow:"none",borderRadius:14,cursor:"pointer",padding:"14px 14px 12px",display:"flex",flexDirection:"column",gap:0,transition:"background 200ms, border-color 200ms, box-shadow 200ms, transform 200ms",transform:o?"translateY(-2px)":"translateY(0)",outline:"none"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:8,minHeight:42},children:[e.jsx("p",{style:{fontSize:12.5,fontWeight:700,lineHeight:1.35,color:a.titleText,display:"-webkit-box",WebkitLineClamp:3,WebkitBoxOrient:"vertical",overflow:"hidden",flex:1,margin:0},children:r.title}),e.jsx("span",{style:{display:"inline-flex",alignItems:"center",fontSize:9,fontWeight:700,padding:"2px 7px",borderRadius:6,flexShrink:0,background:r.is_active?a.badgeActiveBg:a.badgeInactiveBg,color:r.is_active?a.badgeActiveText:a.badgeInactiveText,border:`1px solid ${r.is_active?a.badgeActiveBorder:a.badgeInactiveBorder}`,lineHeight:1.5},children:r.is_active?"Active":"Inactive"})]}),e.jsx("p",{style:{fontSize:10.5,color:a.subText,marginTop:3,marginBottom:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}
1,children:[r.location,r.experience_level].filter(Boolean).join(" · ")||" "}),r.hiring_manager&&e.jsxs("p",{style:{fontSize:10.5,color:a.metaText,margin:"1px 0 0",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:["HM: ",r.hiring_manager]}),e.jsx("div",{style:{height:1,background:"rgba(255,255,255,0.06)",margin:"10px 0 8px"}}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:B.map(({key:t,label:i,icon:o,color:n})=>e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",background:a.rowBg,borderRadius:7,padding:"4px 8px"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[e.jsx("span",{style:{color:n,display:"flex",alignItems:"center"},children:o}),e.jsx("span",{style:{fontSize:10.5,color:a.rowLabelText},children:i})]}),e.jsx("span",{style:{fontSize:12,fontWeight:700,color:a.rowValueText},children:r[t]})]},t))})]})},T=({title:r,icon:t,roles:a,loading:i,p:o,onCardClick:n,emptyMessage:l})=>e.jsxs("section",{style:{display:"flex",flexDirection:"column",gap:12},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx("span",{style:{display:"flex",alignItems:"center"},children:t}),e.jsx("h2",{style:{fontSize:14,fontWeight:700,color:o.sectionTitle,margin:0},children:r}),!i&&e.jsx("span",{style:{display:"inline-flex",alignItems:"center",fontSize:10,fontWeight:700,padding:"1px 8px",borderRadius:20,background:o.countBadgeBg,color:o.countBadgeText},children:a.length})]}),i?e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(210px, 1fr))",gap:10},children:[1,2,3,4].map(r=>e.jsx(_,{p:o},r))}):0===a.length?e.jsx("div",{style:{background:o.emptyCardBg,border:`1px solid ${o.emptyCardBorder}`,borderRadius:12,padding:"24px 16px",textAlign:"center",color:o.emptyText,fontSize:12.5},children:l}):e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(210px, 1fr))",gap:10},children:a.map(r=>e.jsx(S,{role:r,p:o,onClick:()=>n(r.id)},r.id))})]}),k=({value:r,onValueChange:t,p:a,placeholder:i,children:o,width:n=160})=>e.jsxs(s,{value:r,onValueChange:t,children:[e.jsx(d,{style:{width:n,background:a.selectBg,border:`1px solid ${a.selectBorder}`,color:a.selectText,borderRadius:9,fontSize:12,height:34,paddingLeft:10,paddingRight:8,boxShadow:"none"},children:e.jsx(c,{placeholder:i})}),e.jsx(g,{children:o})]}),I=()=>{const{corporateId:s,role:d,loading:c}=a(),g=r(),x=function(){const e=t.useCallback(()=>{if("undefined"!=typeof document){const e=document.documentElement.getAttribute("data-theme")??document.documentElement.getAttribute("class")??"";if(e.includes("light"))return"light";if(e.includes("dark"))return"dark"}return"undefined"!=typeof window&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark"},[]),[r,a]=t.useState(e);return t.useEffect(()=>{const r=new MutationObserver(()=>a(e()));return r.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme","class"]}),()=>r.disconnect()},[e]),r}(),h=j[x],[u,v]=t.useState(!1);t.useEffect(()=>{c||"admin"!==d||s||v(!0)},[c,d,s]);const[f,y]=t.useState([]),[B,_]=t.useState(!0),[S,I]=t.useState(""),[C,A]=t.useState("all"),[H,M]=t.useState("all");t.useEffect(()=>{s&&R()},[s,H]);const R=async()=>{var e;if(!s)return;_(!0);const r="all"!==H?p(new Date,parseInt(H)).toISOString():null;let t=i.from("candidate_profiles").select("pipeline_status, job_role_id, created_at").eq("corporate_id",s),a=i.from("candidate_invitations").select("job_role_id, status, created_at").eq("corporate_id",s).in("status",["pending","invited"]);r&&(t=t.gte("created_at",r),a=a.gte("created_at",r));const[o,n,l,d]=await Promise.all([i.from("corporates").select("name").eq("id",s).single(),i.from("job_roles").select("id, title, is_active, location, experience_level, hiring_manager").eq("corporate_id",s),t,a]);I((null==(e=o.data)?void 0:e.name)||"");const c=l.data||[],g=d.data||[],b=(n.data||[]).map(e=>{const r=c.filter(r=>r.job_role_id===e.id),t=g.filter(r=>r.job_role_id===e.id),a=e=>r.filter(r=>r.pipeline_status===e).length;return{id:e.id,title:e.title,is_active:e.is_active??!0,location:e.location,experience_level:e.experience_level,hiring_manager:e.hiring_manager,invited:a("invited")+t.length,aiScreened:a("screening")+a("ai_screened"),interviewed:a("interviewed"),shortlisted:a("shortlisted"),hired:a("hired"),rejected:a("rejected")}});y(b),_(!1)},D=t.useMemo(()=>[...new Set(f.map(e=>
1e.hiring_manager).filter(Boolean))].sort(),[f]),z=t.useMemo(()=>"all"===C?f:f.filter(e=>e.hiring_manager===C),[f,C]),W=z.filter(e=>e.is_active),N=z.filter(e=>!e.is_active),L=e=>{g(`/corporate/reports?job_role_id=${e}`)};return e.jsxs(e.Fragment,{children:[e.jsx(o,{open:u,onOpenChange:e=>{v(e),e||"admin"!==d||s||g("/dashboard")},portalType:"corporate",onSelect:e=>{sessionStorage.setItem("adminSelectedCorporateId",e),v(!1),window.location.reload()}}),e.jsx(n,{title:"Corporate Dashboard | SmartMentor.ai",description:"Manage your corporate hiring pipeline."}),e.jsx("style",{children:"\n        .cd-select-trigger:focus { outline: none; box-shadow: 0 0 0 2px rgba(16,185,129,0.30) !important; }\n      "}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:0,width:"100%"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"flex-end",justifyContent:"space-between",flexWrap:"wrap",gap:12,marginBottom:18},children:[e.jsxs("div",{children:[e.jsxs("h1",{style:{fontSize:17,fontWeight:800,color:"rgba(255,255,255,0.92)",margin:0,letterSpacing:"-0.3px"},children:[S||"Corporate"," ",e.jsx("span",{style:{color:"#10b981",fontWeight:700},children:" Main Dashboard"})]}),e.jsx("p",{style:{fontSize:11.5,color:"rgba(255,255,255,0.40)",marginTop:2,marginBottom:0},children:"Job roles with candidate pipeline metrics"})]}),e.jsxs("div",{style:{display:"flex",gap:8,flexWrap:"wrap",alignItems:"center"},children:[e.jsx(k,{value:H,onValueChange:M,p:h,placeholder:"Time Range",width:148,children:w.map(r=>e.jsx(l,{value:r.value,children:r.label},r.value))}),D.length>0&&e.jsxs(k,{value:C,onValueChange:A,p:h,placeholder:"Hiring Manager",width:190,children:[e.jsx(l,{value:"all",children:"All Hiring Managers"}),D.map(r=>e.jsx(l,{value:r,children:r},r))]})]})]}),e.jsx("div",{style:{height:1,background:h.divider,marginBottom:20}}),e.jsx(T,{title:"Active Job Roles",icon:e.jsx(b,{style:{width:15,height:15,color:h.sectionIconActive}}),roles:W,loading:B,p:h,onCardClick:L,emptyMessage:"No active job roles. Create one from the Job Roles page."}),e.jsx("div",{style:{height:1,background:h.divider,margin:"20px 0"}}),e.jsx(T,{title:"Inactive / Archived Roles",icon:e.jsx(m,{style:{width:15,height:15,color:h.sectionIconInact}}),roles:N,loading:B,p:h,onCardClick:L,emptyMessage:"No inactive roles."}),e.jsx("div",{style:{height:16}})]})]})};export{I 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.