import{r,j as e}from"./login-aN2dRsX6.js";import{S as c}from"./Select-B6FG_hRH.js";import{h as d}from"./html2pdf-BXDanNDU.js";import"./defineProperty-DRmM3rRU.js";import"./typeof-QjJsDpFa.js";import"./setPrototypeOf-B4fUID9J.js";import"./index-Ci65TyJp.js";import"./app-gmlkJjeD.js";import"./floating-ui.dom-C5vApqfE.js";function N(){const s=r.useRef(null),[a,t]=r.useState(null),l=async()=>{if(!s.current)return;const i={margin:0,filename:"preview.pdf",image:{type:"jpeg",quality:.98},html2canvas:{scale:2},jsPDF:{unit:"in",format:"letter",orientation:"portrait"}};d().from(s.current).set(i).outputPdf("bloburl").then(n=>{t(n)})};return e.jsx(e.Fragment,{children:e.jsx("div",{className:"py-1 container",children:e.jsx("div",{className:"my-3 container",children:e.jsxs("div",{className:"row",children:[e.jsx("div",{className:"col-md-3",children:e.jsxs("div",{className:"card border-primary mx-auto",children:[e.jsx("div",{className:"card-header bg-primary text-white",children:e.jsx("h5",{className:"mb-0",children:"Laporan Transaksi"})}),e.jsxs("div",{className:"card-body",children:[e.jsxs("div",{className:"row mb-2",children:[e.jsx("label",{className:"col-form-label",children:"Jenis Laporan"}),e.jsx(c,{})]}),e.jsxs("div",{className:"row mb-2",children:[e.jsx("label",{className:"col-form-label",children:"Periode"}),e.jsxs("div",{className:"input-group",children:[e.jsx("input",{className:"form-control border-end-0 text-center",type:"date",defaultValue:"2025-06-17"}),e.jsx("span",{className:"input-group-text bg-white",children:"sd"}),e.jsx("input",{className:"form-control border-start-0 text-center",type:"date",defaultValue:"2025-06-17"})]})]})]}),e.jsxs("div",{className:"card-footer flex-end gap-6 flex",children:[e.jsxs("button",{className:"btn btn-danger align-center flex",children:[e.jsx("i",{className:"ri-arrow-left-line mr-2"}),"Kembali"]}),e.jsxs("button",{className:"btn bg-primary gap-6 align-center text-white flex",onClick:l,children:[e.jsx("i",{className:"ri-eye-line"}),"Submit"]})]})]})}),e.jsxs("div",{className:"col-md-9",children:[e.jsx("div",{className:"d-none",children:e.jsx("div",{ref:s,className:"bg-white p-6 shadow-md w-[21cm]",children:e.jsxs("div",{className:"p-3",children:[e.jsx("h1",{className:"text-xl font-bold mb-2",children:"Contoh Dokumen"}),e.jsx("p",{children:"Ini konten HTML yang akan dikonversi ke PDF dan ditampilkan langsung di browser."})]})})}),a&&e.jsx("iframe",{src:a,title:"Preview PDF",className:"border",style:{width:"100%",height:"100vh"}})]})]})})})})}export{N as default};
