codigo0/dist/assets/IctusChecklist-BrhTLt4s.js
planetazuzu 0201f16cf4
Some checks are pending
Auto Deploy to Server / deploy (push) Waiting to run
Update lab configuration 2026-03-22
2026-03-22 22:50:29 +01:00

2 lines
3.2 KiB
JavaScript
Executable file

import{r as c,j as e}from"./0-vendor-react-DWOJpYrt.js";import{B as l}from"./page-ajustes-DgawOEJM.js";import{C as m,c as u,d as x,e as h}from"./page-comunicacion-DmHQUHoW.js";import{f as p,C as N,g as S}from"./timers-DtW-cs9v.js";import"./1-vendor-utils-Delnuc0l.js";import"./2-vendor-markdown-BQlHAcA7.js";const v=[{id:"inicio_sintomas",title:"Inicio de síntomas",description:"Registrar hora de inicio o última vez visto normal.",hasTimerNote:!0},{id:"fast",title:"Evaluación FAST / Cincinnati",description:"Cara, brazo, habla: registrar hallazgos."},{id:"glucemia",title:"Glucemia capilar",description:"Descartar hipoglucemia."},{id:"hta",title:"Constantes y TA",description:"Tomar TA y constantes básicas."},{id:"aviso_hospital",title:"Aviso a centro receptor",description:"Prealerta a hospital con código ictus."},{id:"traslado",title:"Checklist de traslado",description:"Vía aérea, monitorización y seguridad."}],f="ictus_checklist_v1",r={startedAt:null,completed:{}},y=()=>{if(typeof window>"u")return r;try{const s=window.localStorage.getItem(f);if(!s)return r;const i=JSON.parse(s);return{...r,...i}}catch{return r}},b=s=>{if(!(typeof window>"u"))try{window.localStorage.setItem(f,JSON.stringify(s))}catch{}},R=()=>{const[s,i]=c.useState(r),[k,g]=c.useState(Date.now());c.useEffect(()=>{i(y())},[]),c.useEffect(()=>{b(s)},[s]),c.useEffect(()=>{const t=window.setInterval(()=>g(Date.now()),1e3);return()=>window.clearInterval(t)},[]);const a=s.startedAt,n=S(a),j=(t,o)=>{i(d=>({...d,completed:{...d.completed,[t]:o}}))},w=()=>{a||i(t=>({...t,startedAt:Date.now()}))},C=()=>{i(r)};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("header",{className:"space-y-2",children:[e.jsx("h1",{className:"text-xl font-semibold text-foreground",children:"Checklist Código Ictus"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Checklist interactiva con temporizador desde inicio de síntomas."})]}),e.jsxs(m,{children:[e.jsxs(u,{className:"flex flex-row items-center justify-between space-y-0",children:[e.jsx(x,{className:"text-base",children:"Tiempo desde inicio"}),e.jsx("div",{className:"text-sm text-muted-foreground",children:a?p(n):"Sin iniciar"})]}),e.jsxs(h,{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:a?"Monitoriza la ventana terapéutica.":"Inicia cuando se conozca la hora de inicio."}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(l,{onClick:w,disabled:!!a,children:"Iniciar"}),e.jsx(l,{variant:"outline",onClick:C,children:"Reiniciar"})]})]})]}),v.map(t=>e.jsxs(m,{children:[e.jsx(u,{className:"flex flex-row items-center justify-between space-y-0",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(N,{checked:!!s.completed[t.id],onCheckedChange:o=>j(t.id,!!o)}),e.jsx(x,{className:"text-base",children:t.title})]})}),e.jsxs(h,{className:"space-y-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:t.description}),t.hasTimerNote&&e.jsx("div",{className:"rounded-md border border-border/60 bg-muted/30 p-3 text-sm text-muted-foreground",children:a?`Tiempo transcurrido: ${p(n)}`:"Inicia el temporizador al registrar el inicio."})]})]},t.id))]})};export{R as default};