codigo0/dist/assets/page-historial-DRNAlGuI.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 KiB
JavaScript
Executable file

import{j as e,al as r,a as n,ag as i,X as d,Q as x,Y as u,Z as m,F as h}from"./0-vendor-react-DWOJpYrt.js";import{a as f}from"./page-ajustes-DgawOEJM.js";import{f as j}from"./1-vendor-utils-Delnuc0l.js";import"./2-vendor-markdown-BQlHAcA7.js";const b=()=>{const{history:t,clearHistory:a,removeFromHistory:l}=f(),c=s=>{switch(s){case"procedure":return e.jsx(h,{className:"w-5 h-5"});case"drug":return e.jsx(m,{className:"w-5 h-5"});case"tool":return e.jsx(u,{className:"w-5 h-5"});case"manual":return e.jsx(x,{className:"w-5 h-5"});default:return e.jsx(r,{className:"w-5 h-5"})}},o=s=>{switch(s){case"procedure":return"Protocolo";case"drug":return"Fármaco";case"tool":return"Herramienta";case"manual":return"Manual";default:return"Búsqueda"}};return t.length===0?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-foreground mb-1",children:"Historial"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Tus búsquedas y consultas recientes"})]}),e.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[e.jsx(r,{className:"w-16 h-16 text-muted-foreground mb-4 opacity-50"}),e.jsx("p",{className:"text-muted-foreground text-lg mb-2",children:"No hay historial"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Tu historial de búsquedas aparecerá aquí"})]})]}):e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-foreground mb-1",children:"Historial"}),e.jsxs("p",{className:"text-muted-foreground text-sm",children:[t.length," ",t.length===1?"consulta":"consultas"]})]}),t.length>0&&e.jsx("button",{onClick:a,className:"px-4 py-2 text-sm text-destructive hover:text-destructive/80 transition-colors",children:"Limpiar todo"})]}),e.jsx("div",{className:"space-y-2",children:t.map(s=>e.jsxs("div",{className:"flex items-center gap-3 p-4 bg-card border border-border rounded-lg hover:border-primary/50 transition-colors",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-muted flex items-center justify-center flex-shrink-0",children:c(s.type)}),e.jsxs(n,{to:s.path,className:"flex-1 min-w-0",children:[e.jsx("p",{className:"font-medium text-foreground truncate",children:s.title}),e.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[e.jsx("p",{className:"text-sm text-muted-foreground capitalize",children:o(s.type)}),e.jsx("span",{className:"text-muted-foreground",children:"•"}),e.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[e.jsx(i,{className:"w-3 h-3"}),j(new Date(s.searchedAt),{addSuffix:!0})]})]})]}),e.jsx("button",{onClick:()=>l(s.id),className:"w-10 h-10 flex items-center justify-center rounded-lg text-muted-foreground hover:text-destructive transition-colors","aria-label":"Eliminar del historial",children:e.jsx(d,{className:"w-5 h-5"})})]},`${s.id}-${s.searchedAt}`))})]})};export{b as default};