import{u as m,j as e,aT as x,v as h,q as p}from"./vendor-BKmmeuxg.js";import{B as d}from"./button-BpNwv2aE.js";import{C as j}from"./card-D9_SJYq6.js";import{T as u,d as f,b as o,e as l,a as b,c as r}from"./table-DWOXv4Pu.js";import"./index-WW_1X1qx.js";import"./utils-DxSsnXxD.js";const k=()=>{const{exam:n}=m().props,i=s=>{const a=new Date(s);return p(a,"MMMM dd, yyyy, hh:mm a")},c=async(s,a)=>{a.preventDefault();try{const t=route("exam-resources.download",s.id);window.open(t,"_blank")}catch{window.open(s.resource,"_blank")}};return e.jsx("div",{className:"space-y-8",children:n.resources.length>0?e.jsxs(j,{children:[e.jsx("div",{className:"bg-muted rounded-t-lg px-4 py-3",children:e.jsx("h3",{className:"text-lg font-semibold",children:"Exam Resources"})}),e.jsx("div",{className:"overflow-hidden border-t",children:e.jsxs(u,{children:[e.jsx(f,{className:"bg-muted/50",children:e.jsxs(o,{children:[e.jsx(l,{className:"px-4 font-semibold",children:"Title"}),e.jsx(l,{className:"px-4 font-semibold",children:"Date & Time"}),e.jsx(l,{className:"px-4 text-right font-semibold",children:"Action"})]})}),e.jsx(b,{children:n.resources.map((s,a)=>e.jsxs(o,{className:"hover:bg-muted/30",children:[e.jsx(r,{className:"px-4 py-3 font-medium",children:s.title}),e.jsx(r,{className:"text-muted-foreground px-4 py-3",children:i(s.created_at)}),e.jsx(r,{className:"px-4 py-3 text-right",children:e.jsx("div",{className:"flex items-center justify-end gap-2",children:s.type==="link"?e.jsx(d,{asChild:!0,size:"sm",variant:"secondary",children:e.jsxs("a",{target:"_blank",href:s.resource,children:[e.jsx(x,{className:"h-3 w-3"}),"Check"]})}):e.jsxs(d,{size:"sm",variant:"secondary",onClick:t=>c(s,t),children:[e.jsx(h,{className:"h-3 w-3"}),"Download"]})})})]},s.id))})]})})]}):e.jsx("div",{className:"py-12 text-center",children:e.jsx("p",{className:"text-muted-foreground text-lg",children:"No resources available for this exam yet."})})})};export{k as default};