PageSourceSearch

https://hsl.co.in/build/assets/Show-Bgv42p9L.js

js hsl.co.in collected 2026-10-09 22:40:18 UTC 9,084 bytes, 1 lines download raw bytes

1import{X as D,G as F,r as P,j as e,S as k,x as U}from"./app-Mnt2IEGe.js";import{A as B}from"./AuthenticatedLayout-Dh41BUxo.js";import{F as d}from"./file-text-CWVCBaYs.js";import{D as p}from"./download-CiQft0wG.js";import{U as R}from"./user-ad0RTXxq.js";import{C as z}from"./calendar-BUCjVDoJ.js";import{C as M}from"./chevron-left-1rvZdUz9.js";import{C as $}from"./clock-Dnho5FNh.js";import{C as A}from"./circle-check-big-DOBAhIbM.js";import{C as L}from"./circle-x-DDfxBZfp.js";import"./ApplicationLogo-JvKRx6b1.js";import"./ResponsiveNavLink-xYyYAnIm.js";import"./transition-caWIvkel.js";import"./chevron-down-BlAiga6f.js";function se({prescription:s}){var n,m,c,x,h,g,b;const{props:r}=D(),y=(n=r==null?void 0:r.auth)==null?void 0:n.user,{data:t,setData:o,put:N,processing:l,errors:i}=F({status:s.status,admin_notes:s.admin_notes||""}),[T,E]=P.useState(!1),f=a=>{a.preventDefault(),N(route("admin.prescriptions.update",s.id))},v=s.mime_type.startsWith("image/"),w=s.mime_type==="application/pdf",_=a=>{switch(a){case"pending":return"text-yellow-600";case"approved":return"text-green-600";case"rejected":return"text-red-600";default:return"text-gray-600"}},C=a=>{if(a===0)return"0 Bytes";const u=1024,S=["Bytes","KB","MB"],j=Math.floor(Math.log(a)/Math.log(u));return Math.round(a/Math.pow(u,j)*100)/100+" "+S[j]};return e.jsxs(B,{user:y,header:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs(U,{href:route("admin.prescriptions.index"),className:"inline-flex items-center gap-2 text-blue-600 hover:text-blue-800 mb-3 font-medium text-sm",children:[e.jsx(M,{className:"w-4 h-4"}),"Back to Prescriptions"]}),e.jsx("h1",{className:"text-3xl font-bold text-gray-900",children:"Review Prescription"}),e.jsx("p",{className:"text-gray-600 mt-1",children:"Review and manage prescription details"})]}),e.jsxs("div",{className:"text-right",children:[e.jsxs("div",{className:`text-4xl font-bold ${_(t.status)}`,children:[t.status==="pending"&&e.jsx($,{className:"w-10 h-10"}),t.status==="approved"&&e.jsx(A,{className:"w-10 h-10"}),t.status==="rejected"&&e.jsx(L,{className:"w-10 h-10"})]}),e.jsxs("p",{className:"text-sm text-gray-600 mt-2 capitalize",children:["Status: ",t.status]})]})]}),children:[e.jsx(k,{title:`Prescription Review - ${(m=s.user)==null?void 0:m.name}`}),e.jsxs("div",{className:"grid lg:grid-cols-3 gap-8",children:[e.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[e.jsxs("div",{className:"bg-white rounded-3xl border-2 border-gray-200 shadow-xl overflow-hidden",children:[e.jsx("div",{className:"bg-gradient-to-r from-gray-50 to-gray-100 p-6 border-b-2 border-gray-200",children:e.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"File Preview"})}),e.jsx("div",{className:"p-6",children:v?e.jsx("div",{className:"bg-gray-50 rounded-lg overflow-hidden border border-gray-200",children:e.jsx("img",{src:`/storage/${s.file_path}`,alt:s.file_name,className:"w-full h-auto max-h-96 object-contain mx-auto"})}):w?e.jsxs("div",{className:"bg-gray-50 rounded-lg p-8 text-center border border-gray-200",children:[e.jsx(d,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),e.jsx("p",{className:"text-gray-600 mb-4",children:"PDF file preview not available"}),e.jsxs("a",{href:route("admin.prescriptions.download",s.id),className:"inline-flex items-center gap-2 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors",children:[e.jsx(p,{className:"w-4 h-4"}),"Download PDF"]})]}):e.jsxs("div",{className:"bg-gray-50 rounded-lg p-8 text-center border border-gray-200",children:[e.jsx(d,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),e.jsxs("p",{className:"text-gray-600 mb-4",children:["File type: ",s.mime_type]}),e.jsxs("a",{href:route("admin.prescriptions.download",s.id),className:"inline-flex items-center gap-2 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors",children:[e.jsx(p,{className:"w-4 h-4"}),"Download File"]})]})})]}),s.notes&&e.jsxs("div",{className:"bg-white rounded-3xl border-2 border-gray-200 p-6 shadow-sm",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 mb-4",children:"User Notes"}),e.jsx("p",{className:"text-gray-700 bg-blue-50 p-4 rounded-lg border border-blue-200",children:s.notes})]}),e.jsxs("form",{onSubmit:f,className:"space-y-6",children:[e.jsxs("div",{className:"bg-white rounded-3xl border-2 border-gray-200 p-6 shadow-sm",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Update Status"}),e.jsx("div",{className:"grid grid-cols-3 gap-3",children:[{value:"pending",label:"Pending Review",color:"border-yellow-300 bg-yellow-50",textColor:"text-yellow-700"},{value:"approved",label:"Approve",color:"border-green-300 bg-green-50",textColor:"text-green-700"},{value:"rejected",label:"Reject",color:"border-red-300 bg-red-50",textColor:"text-red-700"}].map(a=>e.jsxs("button",{type:"button",onClick:()=>
1o("status",a.value),className:`relative p-4 rounded-lg border-2 transition-all font-medium ${t.status===a.value?`${a.color} ring-2 ring-offset-2 ring-offset-white`:"border-gray-200 bg-white hover:border-gray-300"} ${a.textColor}`,children:[a.label,t.status===a.value&&e.jsx("div",{className:"absolute top-2 right-2 w-4 h-4 bg-current rounded-full"})]},a.value))})]}),e.jsxs("div",{className:"bg-white rounded-3xl border-2 border-gray-200 p-6 shadow-sm",children:[e.jsx("label",{className:"block text-lg font-semibold text-gray-900 mb-3",children:"Admin Notes"}),e.jsx("textarea",{value:t.admin_notes,onChange:a=>o("admin_notes",a.target.value),placeholder:"Add notes about this prescription (visible to the user)...",className:"w-full px-4 py-3 border-2 border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent resize-none",rows:"5",disabled:l}),i.admin_notes&&e.jsx("p",{className:"text-red-600 text-sm mt-1",children:i.admin_notes})]}),e.jsx("button",{type:"submit",disabled:l,className:"w-full px-6 py-3 bg-gradient-to-r from-blue-600 to-blue-700 text-white font-bold rounded-lg hover:shadow-lg disabled:opacity-50 disabled:cursor-not-allowed transition-all",children:l?"Updating...":"Save Changes & Update Status"})]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"bg-white rounded-3xl border-2 border-gray-200 p-6 shadow-sm",children:[e.jsxs("h2",{className:"text-lg font-semibold text-gray-900 mb-4 flex items-center gap-2",children:[e.jsx(R,{className:"w-5 h-5"}),"User Information"]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-gray-600",children:"Name"}),e.jsx("p",{className:"font-medium text-gray-900",children:(c=s.user)==null?void 0:c.name})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-gray-600",children:"Email"}),e.jsx("p",{className:"font-medium text-gray-900 break-all",children:(x=s.user)==null?void 0:x.email})]}),((h=s.user)==null?void 0:h.phone)&&e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-gray-600",children:"Phone"}),e.jsx("p",{className:"font-medium text-gray-900",children:(g=s.user)==null?void 0:g.phone})]})]})]}),e.jsxs("div",{className:"bg-white rounded-3xl border-2 border-gray-200 p-6 shadow-sm",children:[e.jsxs("h2",{className:"text-lg font-semibold text-gray-900 mb-4 flex items-center gap-2",children:[e.jsx(d,{className:"w-5 h-5"}),"File Information"]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-gray-600",children:"File Name"}),e.jsx("p",{className:"font-medium text-gray-900 break-all text-sm",children:s.file_name})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-gray-600",children:"File Size"}),e.jsx("p",{className:"font-medium text-gray-900",children:C(s.file_size)})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-gray-600",children:"File Type"}),e.jsx("p",{className:"font-medium text-gray-900",children:s.mime_type})]})]})]}),e.jsxs("div",{className:"bg-white rounded-3xl border-2 border-gray-200 p-6 shadow-sm",children:[e.jsxs("h2",{className:"text-lg font-semibold text-gray-900 mb-4 flex items-center gap-2",children:[e.jsx(z,{className:"w-5 h-5"}),"Timeline"]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"border-l-2 border-blue-600 pl-4 pb-4",children:[e.jsx("p",{className:"text-xs text-gray-600 uppercase font-bold",children:"Uploaded"}),e.jsxs("p",{className:"text-sm font-medium text-gray-900",children:[new Date(s.created_at).toLocaleDateString()," ",new Date(s.created_at).toLocaleTimeString()]})]}),s.reviewed_at&&e.jsxs("div",{className:"border-l-2 border-green-600 pl-4",children:[e.jsx("p",{className:"text-xs text-gray-600 uppercase font-bold",children:"Reviewed"}),e.jsxs("p",{className:"text-sm font-medium text-gray-900",children:[new Date(s.reviewed_at).toLocaleDateString()," ",new Date(s.reviewed_at).toLocaleTimeString()]}),s.reviewed_by&&e.jsxs("p",{className:"text-xs text-gray-600 mt-1",children:["By: ",(b=s.reviewed_by)==null?void 0:b.name]})]})]})]})]})]})]})}export{se as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.