2 lines
3 KiB
JavaScript
Executable file
2 lines
3 KiB
JavaScript
Executable file
import{j as e,x as l,a as m,W as u,Q as x,Y as h,Z as p,F as f}from"./0-vendor-react-DWOJpYrt.js";import{u as j}from"./page-ajustes-DgawOEJM.js";import"./1-vendor-utils-Delnuc0l.js";import"./2-vendor-markdown-BQlHAcA7.js";const y=()=>{const{favorites:r,removeFavorite:c,clearFavorites:n,getFavoritesByType:i}=j(),d=s=>{switch(s){case"procedure":return e.jsx(f,{className:"w-5 h-5"});case"drug":return e.jsx(p,{className:"w-5 h-5"});case"tool":return e.jsx(h,{className:"w-5 h-5"});case"manual":return e.jsx(x,{className:"w-5 h-5"});default:return e.jsx(l,{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"Favorito"}};return r.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:"Favoritos"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Tus protocolos, fármacos y herramientas favoritas"})]}),e.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[e.jsx(l,{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 tienes favoritos aún"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Añade favoritos desde los protocolos o fármacos usando la estrella"})]})]}):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:"Favoritos"}),e.jsxs("p",{className:"text-muted-foreground text-sm",children:[r.length," ",r.length===1?"favorito":"favoritos"]})]}),r.length>0&&e.jsx("button",{onClick:n,className:"px-4 py-2 text-sm text-destructive hover:text-destructive/80 transition-colors",children:"Limpiar todo"})]}),["procedure","drug","tool","manual"].map(s=>{const a=i(s);return a.length===0?null:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("h2",{className:"font-semibold text-muted-foreground text-sm uppercase tracking-wide",children:[o(s),"s (",a.length,")"]}),e.jsx("div",{className:"space-y-2",children:a.map(t=>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:d(t.type)}),e.jsxs(m,{to:t.path,className:"flex-1 min-w-0",children:[e.jsx("p",{className:"font-medium text-foreground truncate",children:t.title}),e.jsx("p",{className:"text-sm text-muted-foreground capitalize",children:o(t.type)})]}),e.jsx("button",{onClick:()=>c(t.id),className:"w-10 h-10 flex items-center justify-center rounded-lg text-muted-foreground hover:text-destructive transition-colors","aria-label":"Eliminar de favoritos",children:e.jsx(u,{className:"w-5 h-5"})})]},t.id))})]},s)})]})};export{y as default};
|