import{C as k}from"./CoachLayout-DmiDPFPr.js";import{r as f,a as r,b as s,d as c,h as b,e as o,f as t,p,q as n,o as l,F as h,j as w,s as C,t as x,x as D}from"./app-DtilF0jd.js";import{P as v}from"./PrimaryButton-8n0N1KDV.js";import{_ as j}from"./SecondaryButton-C-Ld6z1k.js";import{_ as B,D as L}from"./Modal-uO16Ips-.js";import"./MobileNavigationDrawer-BV2kxNFx.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./DarkModeToggle-wIsj_tj1.js";import"./ImpersonationBanner-BXRKEhdr.js";import"./DropdownLink-Bsw03pEy.js";const N={class:"py-12"},R={class:"max-w-7xl mx-auto sm:px-6 lg:px-8"},E={class:"mb-6 flex justify-end"},V={key:0,class:"bg-white dark:bg-gray-800 overflow-hidden shadow-sm sm:rounded-lg"},M={class:"p-6 text-gray-900 dark:text-gray-100 text-center py-12"},P={class:"mt-6"},S={key:1,class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6"},q={class:"relative h-64 flex"},A={class:"w-1/2 relative"},$=["src"],F={class:"w-1/2 relative border-l border-white/20"},H=["src"],T={class:"p-5"},z={class:"text-xl font-bold text-gray-900 dark:text-white mb-2"},I={key:0,class:"text-gray-600 dark:text-gray-400 text-sm mb-4 line-clamp-3"},G={class:"flex justify-between items-center text-sm text-gray-500 dark:text-gray-400 border-t border-gray-100 dark:border-gray-700 pt-4"},J=["onClick"],K={class:"p-6"},O={class:"mt-6 flex justify-end"},rt={__name:"Index",props:{results:{type:Array,default:()=>[]}},setup(g){const u=f(!1),i=f(null),y=d=>{i.value=d,u.value=!0},m=()=>{u.value=!1,i.value=null},_=()=>{i.value&&D.delete(route("coach.results.destroy",i.value.id),{preserveScroll:!0,onSuccess:()=>m()})};return(d,e)=>(l(),r(h,null,[s(c(b),{title:"Resultados Clientes"}),s(k,null,{header:o(()=>[...e[0]||(e[0]=[t("h2",{class:"font-semibold text-xl text-gray-800 dark:text-gray-200 leading-tight"}," Resultados y Casos de Éxito ",-1)])]),default:o(()=>[t("div",N,[t("div",R,[t("div",E,[s(c(p),{href:d.route("coach.results.create")},{default:o(()=>[s(v,null,{default:o(()=>[...e[1]||(e[1]=[t("svg",{class:"w-5 h-5 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 6v6m0 0v6m0-6h6m-6 0H6"})],-1),n(" Nuevo Resultado ",-1)])]),_:1})]),_:1},8,["href"])]),g.results.length===0?(l(),r("div",V,[t("div",M,[e[3]||(e[3]=t("svg",{class:"mx-auto h-12 w-12 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})],-1)),e[4]||(e[4]=t("h3",{class:"mt-2 text-lg font-medium text-gray-900 dark:text-white"},"No hay resultados publicados",-1)),e[5]||(e[5]=t("p",{class:"mt-1 text-sm text-gray-500 dark:text-gray-400"},"Comparte los cambios físicos de tus clientes para inspirar a otros.",-1)),t("div",P,[s(c(p),{href:d.route("coach.results.create")},{default:o(()=>[s(v,null,{default:o(()=>[...e[2]||(e[2]=[n("Publicar Primer Resultado",-1)])]),_:1})]),_:1},8,["href"])])])])):(l(),r("div",S,[(l(!0),r(h,null,w(g.results,a=>(l(),r("div",{key:a.id,class:"bg-white dark:bg-gray-800 overflow-hidden shadow-sm rounded-xl transition-all hover:shadow-md"},[t("div",q,[t("div",A,[e[6]||(e[6]=t("span",{class:"absolute top-2 left-2 bg-black/60 text-white text-xs px-2 py-1 rounded"},"Antes",-1)),t("img",{src:"/storage/"+a.before_image,class:"w-full h-full object-cover",alt:"Antes"},null,8,$)]),t("div",F,[e[7]||(e[7]=t("span",{class:"absolute top-2 right-2 bg-orange-600 text-white text-xs px-2 py-1 rounded"},"Después",-1)),t("img",{src:"/storage/"+a.after_image,class:"w-full h-full object-cover",alt:"Después"},null,8,H)])]),t("div",T,[t("h3",z,x(a.title),1),a.description?(l(),r("p",I,x(a.description),1)):C("",!0),t("div",G,[t("span",null,x(new Date(a.created_at).toLocaleDateString()),1),t("button",{onClick:Q=>y(a),class:"text-red-500 hover:text-red-700 font-medium transition-colors"}," Eliminar ",8,J)])])]))),128))]))])]),s(B,{show:u.value,onClose:m},{default:o(()=>[t("div",K,[e[10]||(e[10]=t("h2",{class:"text-lg font-medium text-gray-900 dark:text-gray-100"}," ¿Estás seguro de que quieres eliminar este resultado? ",-1)),e[11]||(e[11]=t("p",{class:"mt-1 text-sm text-gray-600 dark:text-gray-400"}," Esta acción no se puede deshacer. Las imágenes serán eliminadas permanentemente. ",-1)),t("div",O,[s(j,{onClick:m},{default:o(()=>[...e[8]||(e[8]=[n(" Cancelar ",-1)])]),_:1}),s(L,{class:"ml-3",onClick:_},{default:o(()=>[...e[9]||(e[9]=[n(" Eliminar Resultado ",-1)])]),_:1})])])]),_:1},8,["show"])]),_:1})],64))}};export{rt as default};
