PageSourceSearch

https://healthserve.ae/assets/AdminDashboard-BJlSAiSd.js

js healthserve.ae collected 2026-10-04 02:40:00 UTC 18,324 bytes, 6 lines download raw bytes

1import{e as P,r as d,y as o,j as e,Z as O,aV as z,aG as J,U as Q,V as C,a0 as Z,L as m,a4 as K,a8 as X,k as Y}from"./index-CzMEFmtw.js";import{h as ee,a as te,b as se}from"./hero-video-3.mp4.asset-BmBy6Fx5.js";import{V as y}from"./video-CKMpWI1a.js";import{L as ae}from"./loader-circle-B3V02kMX.js";import{I as B}from"./inbox-DX1wze4V.js";import{E as re}from"./external-link-DRUqUc_B.js";import{P as ie}from"./plus-DZqQktxt.js";import{T as oe}from"./triangle-alert-BAXlYilG.js";import{T as le}from"./trending-up-BfxTzfPQ.js";import{I as ne}from"./image-DUijihr1.js";import{C as de}from"./chart-column-CkOdDsNL.js";/**
2 * @license lucide-react v0.462.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 j=P("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]),ce={fontFamily:"'Space Grotesk', ui-sans-serif"},S=[{label:"Healthcare team",url:z.url},{label:"Hospital walkthrough",url:ee.url},{label:"Hero video 1",url:te.url},{label:"Hero video 2",url:se.url}];function me(){const[r,a]=d.useState(""),[l,h]=d.useState(null),[b,x]=d.useState(!1);d.useEffect(()=>{o.from("page_content").select("data").eq("page_key","home").eq("section_key","hero.video").maybeSingle().then(({data:i})=>{var n;return a(String(((n=i==null?void 0:i.data)==null?void 0:n.value)??S[1].url))})},[]);const u=async i=>{h(i),x(!1);const{error:n}=await o.from("page_content").upsert({page_key:"home",section_key:"hero.video",data:{value:i}},{onConflict:"page_key,section_key"});h(null),n||(a(i),x(!0),setTimeout(()=>x(!1),2500))};return e.jsxs("div",{className:"relative overflow-hidden bg-white/80 backdrop-blur border border-white ring-1 ring-slate-200/60 rounded-2xl p-5 shadow-[0_8px_30px_-15px_rgba(15,23,42,0.12)] mb-6",children:[e.jsx("div",{className:"absolute inset-x-0 top-0 h-px bg-gradient-to-r from-transparent via-[#F9A01B]/40 to-transparent"}),e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(y,{className:"w-4 h-4 text-[#F9A01B]"}),e.jsx("div",{className:"text-sm font-bold text-slate-900",style:ce,children:"Homepage hero video"}),b&&e.jsxs("span",{className:"text-[11px] font-semibold text-emerald-600 inline-flex items-center gap-1",children:[e.jsx(O,{className:"w-3.5 h-3.5"})," Saved — live on the website"]})]}),e.jsx("div",{className:"text-xs text-slate-500 mb-4",children:"Click a video to make it live. No other steps needed."}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:S.map(i=>{const n=r===i.url;return e.jsxs("button",{type:"button",onClick:()=>u(i.url),className:`group text-left rounded-xl border overflow-hidden transition ${n?"border-[#F9A01B] ring-2 ring-[#F9A01B]/30":"border-slate-200 hover:border-slate-300"}`,children:[e.jsxs("div",{className:"relative bg-black aspect-video",children:[e.jsx("video",{src:i.url,muted:!0,loop:!0,playsInline:!0,preload:"metadata",className:"w-full h-full object-cover",onMouseEnter:f=>f.currentTarget.play().catch(()=>{}),onMouseLeave:f=>f.currentTarget.pause()}),l===i.url&&e.jsx("div",{className:"absolute inset-0 bg-black/50 flex items-center justify-center",children:e.jsx(ae,{className:"w-5 h-5 text-white animate-spin"})})]}),e.jsxs("div",{className:"px-3 py-2 flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs font-semibold text-slate-800",children:i.label}),n?e.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider text-[#B26A00] bg-[#F9A01B]/10 px-2 py-0.5 rounded-full",children:"Live"}):e.jsx("span",{className:"text-[10px] font-semibold text-slate-400 group-hover:text-slate-600",children:"Use this"})]})]},i.url)})})]})}const p={fontFamily:"'Space Grotesk', ui-sans-serif"};function Fe(){const{user:r,isAdmin:a}=J(),[l,h]=d.useState({contacts:0,consultations:0,registrations:0,applications:0,submissions:0,views7d:0}),[b,x]=d.useState([]),[u,i]=d.useState(!1),[n,f]=d.useState([]);d.useEffect(()=>{(async()=>{var F;const t=new Date(Date.now()-6048e5).toISOString(),[c,E,L,M,V,_,H,U,I,R,q]=await Promise.all([o.from("contact_messages").select("id",{count:"exact",head:!0}),o.from("consultation_requests").select("id",{count:"exact",head:!0}),o.from("webinar_registrations").select("id",{count:"exact",head:!0}),o.from("job_applications").select("id",{count:"exact",head:!0}).eq("status","new"),o.from("form_submissions").select("id",{count:"exact",head:!0}).eq("status","new"),o.from("page_views").select("id, created_at").gte("created_at",t),o.from("webinars").select("starts_at, published").eq("published",!0),o.from("contact_messages").select("id, name, email, created_at").order("created_at",{ascending:!1}).limit(3),o.from("consultation_requests").select("id, name, profession, created_at").order("created_at",{ascending:!1}).limit(3),o.from("webinar_registrations").select("id, name, created_at").order("created_at",{ascending:!1}).limit(3),o.from("job_applications").select("id, full_name, position_id, created_at").order("created_at",{ascending:!1}).limit(3)]);h({contacts:c.count??0,consultations:E.count??0,registrations:L.count??0,applications:M.count??0,submissions:V.count??0,views7d:((F=_.data)==null?void 0:F.length)??0});const k=new Array(7).fill(0),A=new Date;
6A.setHours(0,0,0,0),(_.data??[]).forEach(s=>{const w=new Date(s.created_at);w.setHours(0,0,0,0);const N=Math.floor((A.getTime()-w.getTime())/(24*3600*1e3));N>=0&&N<7&&k[6-N]++}),f(k);const G=Date.now(),W=(H.data??[]).some(s=>s.starts_at&&new Date(s.starts_at).getTime()>G);i(!W);const g=[];(U.data??[]).forEach(s=>g.push({id:`c${s.id}`,kind:"Contact",title:s.name||s.email||"New contact",sub:s.email||"",at:s.created_at,to:"/admin/forms"})),(I.data??[]).forEach(s=>g.push({id:`k${s.id}`,kind:"Consultation",title:s.name||"Consultation request",sub:s.profession||"",at:s.created_at,to:"/admin/forms"})),(R.data??[]).forEach(s=>g.push({id:`w${s.id}`,kind:"Webinar",title:s.name||"Registration",sub:"Webinar registration",at:s.created_at,to:"/admin/webinars"})),(q.data??[]).forEach(s=>g.push({id:`a${s.id}`,kind:"Application",title:s.full_name||"Job application",sub:"Careers",at:s.created_at,to:"/admin/applications"})),g.sort((s,w)=>new Date(w.at).getTime()-new Date(s.at).getTime()),x(g.slice(0,8))})()},[]);const D=[{label:"Contact messages",value:l.contacts,icon:B,to:"/admin/forms",gradient:"from-[#2CC5F4]/12 via-white to-white",iconBg:"bg-gradient-to-br from-[#2CC5F4] to-[#0ea5e9]",ring:"hover:ring-[#2CC5F4]/30"},{label:"Consultations",value:l.consultations,icon:Q,to:"/admin/forms",gradient:"from-emerald-100/60 via-white to-white",iconBg:"bg-gradient-to-br from-emerald-500 to-emerald-600",ring:"hover:ring-emerald-500/25"},{label:"Webinar registrations",value:l.registrations,icon:y,to:"/admin/webinars",gradient:"from-violet-100/60 via-white to-white",iconBg:"bg-gradient-to-br from-violet-500 to-indigo-600",ring:"hover:ring-violet-500/25"},{label:"New applications",value:l.applications,icon:C,to:"/admin/applications",gradient:"from-[#F9A01B]/15 via-white to-white",iconBg:"bg-gradient-to-br from-[#F9A01B] to-[#e07f00]",ring:"hover:ring-[#F9A01B]/30"}],T=[{label:"New blog post",to:"/admin/blog",icon:X},{label:"Schedule webinar",to:"/admin/webinars",icon:y},{label:"Upload media",to:"/admin/media",icon:ne},{label:"Post a job",to:"/admin/careers",icon:C},{label:"Edit SEO",to:"/admin/seo",icon:Y},{label:"View analytics",to:"/admin/analytics",icon:de}],$=Math.max(1,...n);return e.jsxs("div",{className:"p-4 sm:p-6 lg:p-8 w-full max-w-[1400px] mx-auto",style:{fontFamily:"'DM Sans', ui-sans-serif"},children:[e.jsxs("div",{className:"relative overflow-hidden rounded-3xl mb-6 border border-white bg-gradient-to-br from-white via-white to-[#F9A01B]/5 shadow-[0_20px_60px_-30px_rgba(15,23,42,0.2)]",children:[e.jsx("div",{className:"absolute -top-24 -right-16 w-72 h-72 rounded-full bg-gradient-to-br from-[#F9A01B]/25 to-transparent blur-3xl pointer-events-none"}),e.jsx("div",{className:"absolute -bottom-24 -left-24 w-80 h-80 rounded-full bg-gradient-to-tr from-[#2CC5F4]/20 to-transparent blur-3xl pointer-events-none"}),e.jsxs("div",{className:"relative p-6 sm:p-8 flex items-start justify-between gap-4 flex-wrap",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full bg-white/70 backdrop-blur border border-[#F9A01B]/20 text-[10px] uppercase tracking-widest font-bold text-[#b46a00] mb-3",children:[e.jsx(Z,{className:"w-3 h-3"})," ",xe()]}),e.jsxs("h1",{className:"text-3xl md:text-4xl font-bold text-slate-900 tracking-tight",style:p,children:["Welcome back",r!=null&&r.email?`, ${r.email.split("@")[0]}`:""]}),e.jsx("p",{className:"text-sm text-slate-600 mt-2 max-w-xl",children:"Here's a live pulse of Healthserve — visitors, submissions and activity all in one place."})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("a",{href:"/",target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-2 h-11 px-4 rounded-xl border border-slate-200 bg-white/90 backdrop-blur text-sm font-semibold text-slate-700 hover:border-slate-300 hover:shadow-sm transition",children:[e.jsx(re,{className:"w-4 h-4"})," View site"]}),e.jsxs(m,{to:"/admin/blog",className:"inline-flex items-center gap-2 h-11 px-5 rounded-xl bg-gradient-to-br from-[#F9A01B] to-[#e07f00] text-white text-sm font-bold shadow-lg shadow-[#F9A01B]/30 hover:shadow-xl hover:shadow-[#F9A01B]/40 hover:-translate-y-0.5 transition-all",children:[e.jsx(ie,{className:"w-4 h-4"})," Create"]})]})]})]}),u&&e.jsx(m,{to:"/admin/webinars",className:"block mb-6 rounded-2xl border border-amber-200/70 bg-gradient-to-r from-amber-50/80 to-white p-4 hover:shadow-md transition",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-amber-100 flex items-center justify-center flex-shrink-0",children:e.jsx(oe,{className:"w-5 h-5 text-amber-600"})}),e.jsxs("div",{className:"text-sm flex-1",children:[e.jsx("div",{className:"font-bold text-amber-900",style:p,children:"No upcoming webinars scheduled"}),e.jsx("div",{className:"text-amber-800/80 mt-0.5",children:"Visitors won't see a live countdown until a future date is set."})]}),e.jsx(j,{className:"w-4 h-4 text-amber-700"})]})}),e.jsx("div",{className:"grid grid-cols-2 xl:grid-cols-4 gap-3 sm:gap-4 mb-6",children:D.map(t=>{const c=t.icon;return e.jsxs(m,{to:t.to,className:`group relative rounded-2xl p-5 bg-gradient-to-br ${t.gradient} border border-white ring-1 ring-slate-200/60 ${t.ring} hover:ring-2 hover:-translate-y-0.5 shadow-[0_8px_30px_-15px_rgba(15,23,42,0.15)] transition-all overflow-hidden`,children:[e.jsx("div",{className:`w-11 h-11 rounded-xl ${t.iconBg} flex items-center justify-center mb-3 shadow-md`,children:e.jsx(c,{className:"w-5 h-5 text-white"})}),e.jsx("div",{className:"text-[10px] uppercase tracking-[0.15em] text-slate-500 font-bold",children:t.label}),e.jsx("div",{className:"text-3xl md:text-4xl font-bold text-slate-900 mt-1 tracking-tight",style:p,children:t.value.toLocaleStr
6ing()}),e.jsx(j,{className:"absolute top-4 right-4 w-4 h-4 text-slate-300 group-hover:text-slate-700 group-hover:translate-x-0.5 group-hover:-translate-y-0.5 transition"})]},t.label)})}),e.jsx(me,{}),e.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-3 gap-4 mb-6",children:[e.jsxs("div",{className:"xl:col-span-2 relative overflow-hidden bg-white/80 backdrop-blur border border-white ring-1 ring-slate-200/60 rounded-2xl p-5 shadow-[0_8px_30px_-15px_rgba(15,23,42,0.12)]",children:[e.jsx("div",{className:"absolute inset-x-0 top-0 h-px bg-gradient-to-r from-transparent via-[#F9A01B]/40 to-transparent"}),e.jsxs("div",{className:"flex items-start justify-between mb-5",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-[10px] uppercase tracking-[0.15em] text-slate-500 font-bold",children:"Last 7 days"}),e.jsxs("div",{className:"text-2xl md:text-3xl font-bold text-slate-900 mt-0.5 tracking-tight",style:p,children:[l.views7d.toLocaleString()," ",e.jsx("span",{className:"text-sm font-medium text-slate-500",children:"page views"})]})]}),e.jsxs(m,{to:"/admin/analytics",className:"text-xs font-semibold text-[#F9A01B] hover:text-[#e07f00] flex items-center gap-1 h-8 px-3 rounded-lg hover:bg-[#F9A01B]/10 transition",children:["Open analytics ",e.jsx(j,{className:"w-3 h-3"})]})]}),e.jsx("div",{className:"flex items-end gap-2 h-36",children:n.map((t,c)=>e.jsxs("div",{className:"flex-1 flex flex-col items-center gap-1.5 group",children:[e.jsx("div",{className:"text-[10px] font-mono text-slate-400 group-hover:text-slate-800 font-semibold",children:t}),e.jsx("div",{className:"w-full relative",children:e.jsx("div",{className:"w-full rounded-t-lg bg-gradient-to-t from-[#F9A01B] via-[#ffb347] to-[#2CC5F4]/60 group-hover:from-[#e07f00] transition-all shadow-sm",style:{height:`${t/$*110+8}px`}})}),e.jsx("div",{className:"text-[10px] uppercase tracking-wider text-slate-400 font-semibold",children:he(6-c)})]},c))}),e.jsxs("div",{className:"mt-5 pt-4 border-t border-slate-100 flex items-center gap-2 text-xs text-slate-500",children:[e.jsx(le,{className:"w-3.5 h-3.5 text-emerald-500"})," Live traffic updates as visitors browse the site."]})]}),e.jsxs("div",{className:"relative overflow-hidden bg-white/80 backdrop-blur border border-white ring-1 ring-slate-200/60 rounded-2xl p-5 shadow-[0_8px_30px_-15px_rgba(15,23,42,0.12)]",children:[e.jsx("div",{className:"absolute inset-x-0 top-0 h-px bg-gradient-to-r from-transparent via-[#2CC5F4]/40 to-transparent"}),e.jsx("div",{className:"text-[10px] uppercase tracking-[0.15em] text-slate-500 font-bold mb-3",children:"Quick actions"}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:T.map(t=>{const c=t.icon;return e.jsxs(m,{to:t.to,className:"flex flex-col items-start gap-2 p-3 rounded-xl border border-slate-200/70 bg-white hover:border-[#F9A01B]/50 hover:shadow-md hover:-translate-y-0.5 transition-all group",children:[e.jsx("div",{className:"w-9 h-9 rounded-lg bg-gradient-to-br from-slate-50 to-white group-hover:from-[#F9A01B]/10 group-hover:to-[#2CC5F4]/10 border border-slate-200/70 flex items-center justify-center text-slate-600 group-hover:text-[#F9A01B] transition",children:e.jsx(c,{className:"w-4 h-4"})}),e.jsx("div",{className:"text-xs font-semibold text-slate-800 leading-tight",children:t.label})]},t.to)})})]})]}),e.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"xl:col-span-2 bg-white/80 backdrop-blur border border-white ring-1 ring-slate-200/60 rounded-2xl overflow-hidden shadow-[0_8px_30px_-15px_rgba(15,23,42,0.12)]",children:[e.jsxs("div",{className:"p-5 border-b border-slate-100 flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-bold text-slate-900",style:p,children:"Recent activity"}),e.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:"Latest submissions across all forms"})]}),e.jsx(m,{to:"/admin/forms",className:"text-xs font-semibold text-[#F9A01B] hover:underline",children:"View all"})]}),e.jsxs("div",{className:"divide-y divide-slate-100",children:[b.length===0&&e.jsxs("div",{className:"p-10 text-center",children:[e.jsx("div",{className:"w-12 h-12 rounded-full bg-slate-100 mx-auto flex items-center justify-center mb-2",children:e.jsx(B,{className:"w-5 h-5 text-slate-400"})}),e.jsx("div",{className:"text-sm text-slate-500",children:"No activity yet."})]}),b.map(t=>e.jsxs(m,{to:t.to,className:"flex items-center gap-3 px-5 py-3.5 hover:bg-slate-50/70 transition",children:[e.jsx("div",{className:`px-2 py-0.5 rounded-full text-[10px] font-bold uppercase tracking-wider ${ue(t.kind)}`,children:t.kind}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"text-sm font-semibold text-slate-900 truncate",children:t.title}),t.sub&&e.jsx("div",{className:"text-xs text-slate-500 truncate",children:t.sub})]}),e.jsx("div",{className:"text-xs text-slate-400 whitespace-nowrap font-mono",children:be(t.at)})]},t.id))]})]}),e.jsxs("div",{className:"bg-white/80 backdrop-blur border border-white ring-1 ring-slate-200/60 rounded-2xl p-5 shadow-[0_8px_30px_-15px_rgba(15,23,42,0.12)]",children:[e.jsx("div",{className:"text-sm font-bold text-slate-900",style:p,children:"System status"}),e.jsx("div",{className:"text-xs text-slate-500 mb-4 mt-0.5",children:"Live health of your site"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{label:"Website",ok:!0}
6),e.jsx(v,{label:"Database",ok:!0}),e.jsx(v,{label:"Analytics",ok:!0}),e.jsx(v,{label:"Forms",ok:!0}),e.jsx(v,{label:"Upcoming webinar",ok:!u,warn:!0})]}),a&&e.jsxs(m,{to:"/admin/settings",className:"mt-4 flex items-center justify-between text-xs font-semibold text-slate-600 hover:text-slate-900 pt-3 border-t border-slate-100",children:[e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(K,{className:"w-3.5 h-3.5"})," Manage settings"]}),e.jsx(j,{className:"w-3.5 h-3.5"})]})]})]})]})}function xe(){const r=new Date().getHours();return r<12?"Good morning":r<18?"Good afternoon":"Good evening"}function he(r){const a=new Date;return a.setDate(a.getDate()-r),a.toLocaleDateString("en",{weekday:"short"}).slice(0,2)}function be(r){const a=Math.floor((Date.now()-new Date(r).getTime())/1e3);return a<60?"just now":a<3600?`${Math.floor(a/60)}m ago`:a<86400?`${Math.floor(a/3600)}h ago`:`${Math.floor(a/86400)}d ago`}function ue(r){switch(r){case"Contact":return"bg-sky-100 text-sky-700";case"Consultation":return"bg-emerald-100 text-emerald-700";case"Webinar":return"bg-violet-100 text-violet-700";case"Application":return"bg-amber-100 text-amber-800";default:return"bg-slate-100 text-slate-600"}}function v({label:r,ok:a,warn:l}){const h=a?"bg-emerald-500":l?"bg-amber-500":"bg-red-500",b=a?"bg-emerald-50":l?"bg-amber-50":"bg-red-50",x=a?"Operational":l?"Attention":"Down",u=a?"text-emerald-700":l?"text-amber-700":"text-red-700";return e.jsxs("div",{className:`flex items-center justify-between text-sm rounded-lg px-3 py-2 ${b}`,children:[e.jsx("span",{className:"text-slate-700 font-medium",children:r}),e.jsxs("span",{className:`flex items-center gap-2 text-[11px] font-semibold ${u}`,children:[e.jsx("span",{className:`w-2 h-2 rounded-full ${h} ${a?"":"animate-pulse"}`}),x]})]})}export{Fe 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.