Files
humicletter/_next/static/chunks/app/letter/acceptanceletter/showLetter/page-cb403df05e9540cc.js
T
2026-06-09 16:51:15 +07:00

1 line
9.1 KiB
JavaScript

(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[822],{477:()=>{},4085:(e,t,a)=>{"use strict";a.d(t,{$:()=>l});var r=a(5155);a(2115);var s=a(2317),n=a(1027),i=a(9602);let o=(0,n.F)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-[color,box-shadow] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",outline:"border border-input bg-background shadow-xs hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function l(e){let{className:t,variant:a,size:n,asChild:l=!1,...c}=e,d=l?s.DX:"button";return(0,r.jsx)(d,{"data-slot":"button",className:(0,i.cn)(o({variant:a,size:n,className:t})),...c})}},9345:(e,t,a)=>{Promise.resolve().then(a.bind(a,9966))},9602:(e,t,a)=>{"use strict";a.d(t,{cn:()=>n});var r=a(3463),s=a(9795);function n(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];return(0,s.QP)((0,r.$)(t))}},9966:(e,t,a)=>{"use strict";a.d(t,{default:()=>_});var r=a(5155),s=a(6046),n=a(7711),i=a(2115),o=a(7006),l=a(7364),c=a(4085);function d(){let e=(0,s.useRouter)();return(0,r.jsxs)(c.$,{onClick:()=>e.push("/letter/acceptanceletter"),className:"bg-white text-black border border-gray-300 flex items-center gap-2",children:[(0,r.jsx)(l.A,{size:16})," Back"]})}var h=a(4003),m=a(4857);let{pdf:u}=a(4003),g=(0,n.default)(()=>Promise.resolve().then(a.bind(a,4003)).then(e=>e.PDFViewer),{loadableGenerated:{webpack:()=>[4003]},ssr:!1}),x=h.StyleSheet.create({page:{padding:40,fontSize:11,fontFamily:"Calibri"},bold:{fontFamily:"Calibri",fontWeight:"bold"},section:{marginBottom:10},footer:{position:"absolute",bottom:0,left:0,right:0,textAlign:"center",fontSize:10,fontFamily:"Calibri"},paragraph:{marginBottom:6,lineHeight:1.6,fontSize:11,fontFamily:"Calibri"},right:{textAlign:"right"},line:{flexDirection:"row",marginBottom:2},label:{width:100}});function p(e){let{nomor_surat_acceptance:t,nama_mahasiswa:a,nomor_induk_mahasiswa:s,program_studi_mahasiswa:n,start_date:i,address_to:o,completion_date:l,tahun_ajaran:c,created_at:d}=e;return(0,r.jsx)(h.Document,{children:(0,r.jsxs)(h.Page,{size:"A4",style:x.page,children:[(0,r.jsxs)(h.View,{style:{flexDirection:"row",alignItems:"center",marginBottom:10},children:[(0,r.jsx)(h.Image,{src:"/assets/logo-humic-surat.jpg",style:{width:90,height:90}}),(0,r.jsxs)(h.View,{style:{marginLeft:10,flex:1,marginBottom:10},children:[(0,r.jsxs)(h.Text,{style:{fontSize:18,fontWeight:"bold",fontFamily:"Times-Roman",textAlign:"center"},children:["Pusat Penelitian HUMIC Engineering","\n","Universitas Telkom"]}),(0,r.jsxs)(h.Text,{style:{fontSize:10,textAlign:"center",marginTop:7,fontFamily:"Times-Roman"},children:["Jl. Telekomunikasi Terusan Buah Batu, Bandung 40257, Jawa Barat, Indonesia","\n","Telp/Faks: +6281321397936 / +6222-70658638 / +6222-7565931"]})]})]}),(0,r.jsx)(h.View,{style:{borderBottomWidth:2,borderColor:"#000",marginBottom:10,width:"100%"}}),(0,r.jsxs)(h.View,{style:x.section,children:[(0,r.jsxs)(h.View,{style:x.line,children:[(0,r.jsx)(h.Text,{style:x.label,children:"Nomor"}),(0,r.jsxs)(h.Text,{children:[": ",t]})]}),(0,r.jsxs)(h.View,{style:x.line,children:[(0,r.jsx)(h.Text,{style:x.label,children:"Lampiran"}),(0,r.jsx)(h.Text,{children:": -"})]}),(0,r.jsxs)(h.View,{style:x.line,children:[(0,r.jsx)(h.Text,{style:x.label,children:"Perihal"}),(0,r.jsx)(h.Text,{children:": Surat Penerimaan Kerja Praktek"})]})]}),(0,r.jsxs)(h.View,{style:x.section,children:[(0,r.jsx)(h.Text,{children:"Kepada Yth."}),(0,r.jsx)(h.Text,{children:o}),(0,r.jsx)(h.Text,{children:"di Tempat"})]}),(0,r.jsxs)(h.View,{style:x.section,children:[(0,r.jsx)(h.Text,{style:x.paragraph,children:"Dengan hormat,"}),(0,r.jsx)(h.Text,{style:x.paragraph,children:"Sehubungan dengan pengajuan kerja praktek di CoE Humic Engineering yang telah diajukan oleh mahasiswa atas nama:"})]}),(0,r.jsxs)(h.View,{style:x.section,children:[(0,r.jsxs)(h.View,{style:x.line,children:[(0,r.jsx)(h.Text,{style:x.label,children:"Nama"}),(0,r.jsxs)(h.Text,{children:[": ",a]})]}),(0,r.jsxs)(h.View,{style:x.line,children:[(0,r.jsx)(h.Text,{style:x.label,children:"NIM"}),(0,r.jsxs)(h.Text,{children:[": ",s]})]}),(0,r.jsxs)(h.View,{style:x.line,children:[(0,r.jsx)(h.Text,{style:x.label,children:"Prodi"}),(0,r.jsxs)(h.Text,{children:[": ",n]})]})]}),(0,r.jsxs)(h.View,{style:x.section,children:[(0,r.jsxs)(h.Text,{style:[x.paragraph,{marginTop:20}],children:["Dengan ini kami menyatakan bahwa mahasiswa yang bersangkutan"," ",(0,r.jsx)(h.Text,{style:x.bold,children:"DITERIMA"})," untuk melaksanakan Kerja Praktek di CoE Human Centric Engineering, Telkom University. Kegiatan ini dihitung pada ",i," s.d. ",l," ","periode Tahun Ajaran ",c,"."]}),(0,r.jsx)(h.Text,{style:x.paragraph,children:"Demikian surat keterangan ini kami buat agar dapat dipergunakan sebagaimana mestinya."})]}),(0,r.jsxs)(h.View,{style:[x.section],children:[(0,r.jsxs)(h.Text,{children:["Bandung, ",d]}),(0,r.jsx)(h.Image,{src:"/assets/ttd.png",style:{width:100,height:50}}),(0,r.jsx)(h.Text,{style:{textDecoration:"underline"},children:"Assoc. Prof. Dr. Satria Mandal"}),(0,r.jsx)(h.Text,{children:"Direktur CoE HUMIC Engineering"})]}),(0,r.jsx)(h.View,{style:x.footer,children:(0,r.jsx)(h.Image,{src:"/assets/footer.jpg",style:{width:"100%"}})})]})})}function _(){let e=(0,s.useSearchParams)();(0,s.useRouter)();let t=e.get("id"),[a,n]=(0,i.useState)(null),[l,h]=(0,i.useState)(!0),[x,_]=(0,i.useState)(null);(0,i.useEffect)(()=>{let e=async()=>{try{let e=localStorage.getItem("authToken"),a=await fetch("https://cetaksuratkp-api.humicprototyping.com/api/letter/".concat(t),{headers:{Accept:"application/json",Authorization:"Bearer ".concat(e)}});if(!a.ok){let e=await a.json().catch(()=>({}));throw Error("API Error ".concat(a.status,": ").concat(e.message||a.statusText))}let r=await a.json();console.log("Fetched Data:",r),n(r.data)}catch(e){e instanceof Error?(_(e.message),console.error("API Error:",e)):_("An unknown error occurred")}finally{h(!1)}};t&&e()},[t]);let j=e=>{try{return(0,o.GP)(new Date(e),"dd MMMM yyyy")}catch(e){return console.error("Error formatting date:",e),"-"}};if(x)return(0,r.jsxs)("div",{children:["Error: ",x]});if(!a)return(0,r.jsx)("div",{children:"No letter data found"});console.log("Acceptance Letter Data:",{nomor_surat_acceptance:a.nomor_surat_acceptance||"-",address_to:a.address_to||"-",nama_mahasiswa:a.nama_mahasiswa||"-",nomor_induk_mahasiswa:a.nomor_induk_mahasiswa||"-",program_studi_mahasiswa:a.program_studi_mahasiswa||"-",start_date:a.start_date?j(a.start_date):"-",completion_date:a.completion_date?j(a.completion_date):"-",tahun_ajaran:a.tahun_ajaran||"-",created_at:a.created_at?j(a.created_at):"-"});let f=async()=>{let e=await u((0,r.jsx)(p,{nomor_surat_acceptance:a.nomor_surat_acceptance||"-",address_to:a.address_to||"-",nama_mahasiswa:a.nama_mahasiswa||"-",nomor_induk_mahasiswa:a.nomor_induk_mahasiswa||"-",program_studi_mahasiswa:a.program_studi_mahasiswa||"-",start_date:a.start_date?j(a.start_date):"-",completion_date:a.completion_date?j(a.completion_date):"-",tahun_ajaran:a.tahun_ajaran||"-",tanggalSurat:a.created_at?j(a.created_at):"-"})).toBlob(),t=URL.createObjectURL(e),s=document.createElement("a");s.href=t,s.download="Surat-Penerimaan-".concat(a.nama_mahasiswa||"unknown",".pdf"),s.click(),URL.revokeObjectURL(t)};return(0,r.jsxs)("div",{className:"min-h-screen bg-gray-100 px-10 py-6",children:[(0,r.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,r.jsx)(d,{}),(0,r.jsxs)(c.$,{onClick:f,className:"bg-red-600 text-white flex items-center gap-2",children:[(0,r.jsx)(m.A,{size:16})," Download PDF"]})]}),(0,r.jsx)(g,{width:"100%",height:"1000",children:(0,r.jsx)(p,{nomor_surat_acceptance:a.nomor_surat_acceptance||"-",nama_mahasiswa:a.nama_mahasiswa||"-",nomor_induk_mahasiswa:a.nomor_induk_mahasiswa||"-",program_studi_mahasiswa:a.program_studi_mahasiswa||"-",start_date:a.start_date?j(a.start_date):"-",completion_date:a.completion_date?j(a.completion_date):"-",tahun_ajaran:a.tahun_ajaran||"-",created_at:a.created_at?j(a.created_at):"-",address_to:a.address_to||"-"})})]})}h.Font.register({family:"Calibri",fonts:[{src:"/fonts/CALIBRI.TTF"},{src:"/fonts/CALIBRIB.TTF",fontWeight:"bold"}]}),h.Font.register({family:"Times-Roman",fonts:[{src:"/fonts/times/TIMES.TTF"},{src:"/fonts/times/TIMESBD.TTF",fontWeight:"bold"}]})}},e=>{var t=t=>e(e.s=t);e.O(0,[792,247,788,746,251,501,941,186,441,587,358],()=>t(9345)),_N_E=e.O()}]);