PageSourceSearch

https://bulksmsshop.com/build/assets/Certificate-DMiHes6E.js

js bulksmsshop.com collected 2026-10-10 00:13:26 UTC 8,394 bytes, 3 lines download raw bytes

1import{r as a,b as P,a as o,j as e,H as E}from"./app-DuGb8-Kq.js";import{A as L}from"./AdminLayout-BRcEOI6m.js";import{S as N}from"./sweetalert2.esm.all-Bhs_5ACv.js";import{P as A,a as T,T as v}from"./trash-2-BdXvXxU5.js";import{A as D}from"./index-CuWfEHFg.js";import{m as y}from"./proxy-COvggyv1.js";import"./app-CjH6KEP1.js";import"./house-LGn24uwX.js";import"./createLucideIcon-1pCUVPSG.js";import"./file-text-Bft_Sffl.js";import"./credit-card-LHw9WGVl.js";import"./search-G6dtqwXZ.js";import"./camera-B_iYr9Jd.js";function V({certifications:p,filters:g}){const[h,w]=a.useState(g?.search||""),[n,C]=a.useState(g?.show_trash||!1),[d,u]=a.useState(!1),[m,x]=a.useState({}),{flash:l}=P().props,[k,f]=a.useState(!1),[s,r]=a.useState({id:null,cert_name:"",image:null}),i=s.id!==null;a.useEffect(()=>{const t=setTimeout(()=>{o.get(route("admin.certificate"),{search:h,show_trash:n?1:0},{preserveState:!0,replace:!0,preserveScroll:!0})},500);return()=>clearTimeout(t)},[h,n]);const S=()=>{u(!0),x({});const t={cert_name:s.cert_name};s.image instanceof File&&(t.image=s.image),i&&(t._method="PUT");const c=i?route("admin.certificate.update",s.id):route("admin.certificate.store");o.post(c,t,{forceFormData:!0,preserveScroll:!0,onSuccess:()=>{j(),u(!1)},onError:_=>{x(_),u(!1)}})},j=()=>{f(!1),x({}),r({id:null,cert_name:"",image:null})},b=s.image?typeof s.image=="string"?`/storage/${s.image}`:URL.createObjectURL(s.image):null;return a.useEffect(()=>{l?.success&&N.fire({icon:"success",title:"Success",text:l.success,timer:2e3,showConfirmButton:!1}),l?.error&&N.fire({icon:"error",title:"Error",text:l.error})},[l]),e.jsxs(L,{children:[e.jsx(E,{title:"Certifications - Admin"}),e.jsxs("div",{className:"p-6 space-y-6",children:[e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-4",children:[e.jsx("h1",{className:"text-2xl font-bold",children:"All Certifications"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[e.jsx("input",{type:"checkbox",checked:n,onChange:t=>C(t.target.checked)}),"Trash"]}),e.jsx("input",{value:h,onChange:t=>w(t.target.value),placeholder:"Search...",className:"border px-3 py-2 rounded-xl"}),e.jsxs("button",{onClick:()=>{x({}),r({id:null,cert_name:"",image:null}),f(!0)},className:"bg-blue-600 text-white px-4 py-2 rounded-xl flex items-center gap-2 hover:bg-blue-700",children:[e.jsx(A,{size:16}),"Add Certifcate"]})]})]}),e.jsx("div",{className:"bg-white rounded-2xl shadow overflow-hidden",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{className:"bg-slate-700 text-white",children:e.jsxs("tr",{children:[e.jsx("th",{className:"p-4 text-left",children:"Image"}),e.jsx("th",{className:"p-4 text-left",children:"Certificate Name"}),e.jsx("th",{className:"p-4 text-left",children:"Date"}),e.jsx("th",{className:"p-4 text-left",children:"Actions"})]})}),e.jsx("tbody",{children:p?.data?.length>0?p.data.map(t=>e.jsxs("tr",{className:"border-b hover:bg-gray-50",children:[e.jsx("td",{className:"p-4",children:e.jsx("img",{src:`/storage/${t.image}`,alt:t.cert_name,className:"w-16 h-12 object-cover rounded"})}),e.jsx("td",{className:"p-4 font-medium truncate",children:t.cert_name}),e.jsx("td",{className:"p-4",children:new Date(t.created_at).toLocaleDateString("en-IN")}),e.jsxs("td",{className:"p-4 flex gap-3 mt-2",children:[e.jsx("button",{onClick:()=>{r({id:t.id,cert_name:t.cert_name||"",image:t.image||null}),f(!0)},className:"text-blue-600",children:e.jsx(T,{size:18})}),n?e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:()=>o.post(route("admin.certificate.restore",t.id)),className:"text-green-600 font-medium",children:"Restore"}),e.jsxs("button",{onClick:()=>{confirm("Permanently delete this certificate?")&&o.delete(route("admin.certificate.forceDelete",t.id))},className:"text-red-600 font-medium",children:[e.jsx(v,{size:18})," Delete Forever"]})]}):e.jsx("button",{onClick:()=>{confirm("Move to trash?")&&o.delete(route("admin.certificate.destroy",t.id))},className:"text-red-600",children:e.jsx(v,{size:18})})]})]},t.id)):e.jsx("tr",{children:e.jsx("td",{colSpan:"9",className:"py-12 text-center",children:e.jsxs("div",{className:"flex flex-col items-center justify-center text-gray-500",children:[e.jsx("svg",{className:"w-12 h-12 mb-3 text-gray-300",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20 13V7a2 2 0 00-2-2h-4l-2-2H6a2 2 0 00-2 2v14a2 2 0 002 2h8"})}),e.jsx("p",{className:"text-lg font-medium",children:"No Certificate Found"}),e.jsx("p",{className:"text-sm text-gray-400",children:"Try adding a Certificate or change search f
1ilters"})]})})})})]})})]}),e.jsx(D,{children:k&&e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[e.jsx(y.div,{className:"absolute inset-0 bg-black/50",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}}),e.jsxs(y.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},className:"relative bg-white w-full max-w-4xl p-6 rounded-2xl shadow-xl overflow-y-auto max-h-[90vh]",onClick:t=>t.stopPropagation(),children:[e.jsx("button",{onClick:j,className:"absolute top-4 right-4 w-9 h-9 flex items-center justify-center rounded-full bg-gray-100 hover:bg-red-500 hover:text-white transition shadow-sm",children:"✕"}),e.jsx("h2",{className:"text-xl font-bold mb-6",children:i?"Edit Certificate":"Add Certificate"}),e.jsxs("div",{className:"grid md:grid-cols-1 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block mb-1 font-medium",children:"Certificate Name"}),e.jsx("input",{type:"text",value:s.cert_name,placeholder:"Enter Certificate Name",onChange:t=>r(c=>({...c,cert_name:t.target.value})),className:"w-full border rounded-xl p-3"}),m.cert_name&&e.jsx("p",{className:"text-red-500 text-sm mt-1",children:m.cert_name})]}),e.jsxs("div",{className:"md:col-span-2 mb-4",children:[e.jsx("label",{className:"block mb-2 font-semibold text-gray-700",children:"Certificate Image"}),e.jsxs("div",{className:"relative group border-2 border-dashed border-gray-300 hover:border-blue-500 transition-all duration-300 rounded-2xl bg-gradient-to-b from-gray-50 to-white p-6 cursor-pointer",children:[e.jsx("input",{type:"file",accept:"image/*",onChange:t=>r(c=>({...c,image:t.target.files[0]})),className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer"}),m.image&&e.jsx("p",{className:"text-red-500 text-sm mt-2",children:m.image}),e.jsxs("div",{className:"flex flex-col items-center justify-center text-center space-y-3",children:[e.jsx("div",{className:"w-14 h-14 flex items-center justify-center rounded-full bg-blue-50 group-hover:bg-blue-100 transition",children:e.jsx("svg",{className:"w-7 h-7 text-blue-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1M16 12l-4-4m0 0L8 12m4-4v12"})})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-700 font-medium",children:"Drag & drop your image here"}),e.jsx("p",{className:"text-sm text-gray-400",children:"or click to browse (PNG, JPG, JPEG)"})]})]})]}),b&&e.jsxs("div",{className:"mt-4 relative inline-block",children:[e.jsx("img",{src:b,alt:"preview",className:"w-48 h-32 object-cover rounded-xl border shadow-md"}),e.jsx("button",{type:"button",onClick:()=>r(t=>({...t,image:null})),className:"absolute -top-2 -right-2 bg-red-500 text-white w-6 h-6 rounded-full flex items-center justify-center text-xs hover:bg-red-600",children:"✕"})]})]})]}),e.jsx("div",{className:"flex justify-end gap-3 mt-6",children:e.jsxs("button",{onClick:S,disabled:d,className:`px-5 py-2 rounded-xl text-white flex items-center gap-2 transition
2                                                ${d?"bg-blue-400 cursor-not-allowed":"bg-blue-600 hover:bg-blue-700"}
3                                            `,children:[d&&e.jsxs("svg",{className:"w-4 h-4 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v8H4z"})]}),d?i?"Updating...":"Saving...":i?"Update Certificate":"Save Certificate"]})})]})]})})]})}export{V 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.