Files
humicletter/_next/static/chunks/app/letter/completionletter/showLetter/page-ded16d837713abb8.js
T
2026-06-09 16:57:55 +07:00

1 line
9.1 KiB
JavaScript

(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[990],{477:()=>{},920:(e,t,a)=>{"use strict";a.d(t,{default:()=>_});var s=a(5155),r=a(6046),n=a(7711),i=a(2115),o=a(7006),l=a(4085),d=a(4003),c=a(7364);function h(){let e=(0,r.useRouter)();return(0,s.jsxs)(l.$,{onClick:()=>e.push("/letter/completionletter"),className:"bg-white text-black border border-gray-300 flex items-center gap-2",children:[(0,s.jsx)(c.A,{size:16})," Back"]})}var 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=d.StyleSheet.create({page:{padding:40,fontSize:11,fontFamily:"Calibri"},bold:{fontFamily:"Calibri",fontWeight:"bold"},footer:{position:"absolute",bottom:0,left:0,right:0,textAlign:"center",fontSize:10,fontFamily:"Calibri"},section:{marginBottom:10},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_completion:t,address_to:a,nama_mahasiswa:r,nomor_induk_mahasiswa:n,program_studi_mahasiswa:i,start_date:o,completion_date:l,tahun_ajaran:c,created_at:h}=e;return(0,s.jsx)(d.Document,{children:(0,s.jsxs)(d.Page,{size:"A4",style:x.page,children:[(0,s.jsxs)(d.View,{style:{flexDirection:"row",alignItems:"center",marginBottom:10},children:[(0,s.jsx)(d.Image,{src:"/assets/logo-humic-surat.jpg",style:{width:90,height:90}}),(0,s.jsxs)(d.View,{style:{marginLeft:10,flex:1,marginBottom:10},children:[(0,s.jsxs)(d.Text,{style:{fontSize:18,fontWeight:"bold",fontFamily:"Times-Roman",textAlign:"center"},children:["Pusat Penelitian HUMIC Engineering","\n","Universitas Telkom"]}),(0,s.jsxs)(d.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,s.jsx)(d.View,{style:{borderBottomWidth:2,borderColor:"#000",marginBottom:10,width:"100%"}}),(0,s.jsxs)(d.View,{style:x.section,children:[(0,s.jsxs)(d.View,{style:x.line,children:[(0,s.jsx)(d.Text,{style:x.label,children:"Nomor"}),(0,s.jsxs)(d.Text,{children:[": ",t]})]}),(0,s.jsxs)(d.View,{style:x.line,children:[(0,s.jsx)(d.Text,{style:x.label,children:"Lampiran"}),(0,s.jsx)(d.Text,{children:": -"})]}),(0,s.jsxs)(d.View,{style:x.line,children:[(0,s.jsx)(d.Text,{style:x.label,children:"Perihal"}),(0,s.jsx)(d.Text,{children:": Surat Keterangan Selesai Kerja Praktek"})]})]}),(0,s.jsxs)(d.View,{style:x.section,children:[(0,s.jsx)(d.Text,{children:"Kepada Yth."}),(0,s.jsx)(d.Text,{children:a}),(0,s.jsx)(d.Text,{children:"di Tempat"})]}),(0,s.jsxs)(d.View,{style:x.section,children:[(0,s.jsx)(d.Text,{style:x.paragraph,children:"Dengan hormat,"}),(0,s.jsx)(d.Text,{style:x.paragraph,children:"Sehubungan dengan telah selesainya kerja praktek di CoE Humic Engineering yang telah dilaksanakan oleh mahasiswa atas nama:"})]}),(0,s.jsxs)(d.View,{style:x.section,children:[(0,s.jsxs)(d.View,{style:x.line,children:[(0,s.jsx)(d.Text,{style:x.label,children:"Nama"}),(0,s.jsxs)(d.Text,{children:[": ",r]})]}),(0,s.jsxs)(d.View,{style:x.line,children:[(0,s.jsx)(d.Text,{style:x.label,children:"NIM"}),(0,s.jsxs)(d.Text,{children:[": ",n]})]}),(0,s.jsxs)(d.View,{style:x.line,children:[(0,s.jsx)(d.Text,{style:x.label,children:"Prodi"}),(0,s.jsxs)(d.Text,{children:[": ",i]})]})]}),(0,s.jsxs)(d.View,{style:x.section,children:[(0,s.jsxs)(d.Text,{style:[x.paragraph,{marginTop:20}],children:["Dengan ini kami menyatakan bahwa mahasiswa yang bersangkutan"," ",(0,s.jsx)(d.Text,{style:x.bold,children:"TELAH MENYELESAIKAN"})," Kerja Praktek di CoE Human Centric Engineering, Telkom University. Kegiatan ini telah dilaksanakan pada ",o," s.d. ",l," periode Tahun Ajaran ",c,"."]}),(0,s.jsx)(d.Text,{style:x.paragraph,children:"Demikian surat keterangan ini kami buat agar dapat dipergunakan sebagaimana mestinya."})]}),(0,s.jsxs)(d.View,{style:[x.section],children:[(0,s.jsxs)(d.Text,{children:["Bandung, ",h]}),(0,s.jsx)(d.Image,{src:"/assets/ttd.png",style:{width:100,height:50}}),(0,s.jsx)(d.Text,{style:{textDecoration:"underline"},children:"Assoc. Prof. Dr. Satria Mandal"}),(0,s.jsx)(d.Text,{children:"Direktur CoE HUMIC Engineering"})]}),(0,s.jsx)(d.View,{style:x.footer,children:(0,s.jsx)(d.Image,{src:"/assets/footer.jpg",style:{width:"100%"}})})]})})}function _(){let e=(0,r.useSearchParams)().get("id"),[t,a]=(0,i.useState)(null),[n,d]=(0,i.useState)(!0),[c,x]=(0,i.useState)(null);(0,i.useEffect)(()=>{let t=async()=>{try{let t=localStorage.getItem("authToken"),s=await fetch("https://cetaksuratkp-api.humicprototyping.net/api/letter/".concat(e),{headers:{Accept:"application/json",Authorization:"Bearer ".concat(t)}});if(!s.ok){let e=await s.json().catch(()=>({}));throw Error("API Error ".concat(s.status,": ").concat(e.message||s.statusText))}let r=await s.json();console.log("Fetched Data:",r),a(r.data)}catch(e){e instanceof Error?(x(e.message),console.error("API Error:",e)):x("An unknown error occurred")}finally{d(!1)}};e&&t()},[e]);let _=e=>{try{return(0,o.GP)(new Date(e),"dd MMMM yyyy")}catch(e){return console.error("Error formatting date:",e),"-"}};if(c)return(0,s.jsxs)("div",{children:["Error: ",c]});if(!t)return(0,s.jsx)("div",{children:"No letter data found"});console.log("Completion Letter Data:",{nomor_surat_completion:t.nomor_surat_completion||"-",address_to:t.address_to||"-",nama_mahasiswa:t.nama_mahasiswa||"-",nomor_induk_mahasiswa:t.nomor_induk_mahasiswa||"-",program_studi_mahasiswa:t.program_studi_mahasiswa||"-",start_date:t.start_date?_(t.start_date):"-",completion_date:t.completion_date?_(t.completion_date):"-",tahun_ajaran:t.tahun_ajaran||"-",created_at:t.created_at?_(t.created_at):"-"});let j=async()=>{let e=await u((0,s.jsx)(p,{nomor_surat_completion:t.nomor_surat_completion||"-",address_to:t.address_to||"-",nama_mahasiswa:t.nama_mahasiswa||"-",nomor_induk_mahasiswa:t.nomor_induk_mahasiswa||"-",program_studi_mahasiswa:t.program_studi_mahasiswa||"-",start_date:t.start_date?_(t.start_date):"-",completion_date:t.completion_date?_(t.completion_date):"-",tahun_ajaran:t.tahun_ajaran||"-",tanggalSurat:t.created_at?_(t.created_at):"-"})).toBlob(),a=URL.createObjectURL(e),r=document.createElement("a");r.href=a,r.download="Surat-Penerimaan-".concat(t.nama_mahasiswa||"unknown",".pdf"),r.click(),URL.revokeObjectURL(a)};return(0,s.jsxs)("div",{className:"min-h-screen bg-gray-100 px-10 py-6",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,s.jsx)(h,{}),(0,s.jsxs)(l.$,{onClick:j,className:"bg-red-600 text-white flex items-center gap-2",children:[(0,s.jsx)(m.A,{size:16})," Download PDF"]})]}),(0,s.jsx)(g,{width:"100%",height:"1000",children:(0,s.jsx)(p,{nomor_surat_completion:t.nomor_surat_completion||"-",address_to:t.address_to||"-",nama_mahasiswa:t.nama_mahasiswa||"-",nomor_induk_mahasiswa:t.nomor_induk_mahasiswa||"-",program_studi_mahasiswa:t.program_studi_mahasiswa||"-",start_date:t.start_date?_(t.start_date):"-",completion_date:t.completion_date?_(t.completion_date):"-",tahun_ajaran:t.tahun_ajaran||"-",created_at:t.created_at?_(t.created_at):"-"})})]})}d.Font.register({family:"Calibri",fonts:[{src:"/fonts/CALIBRI.TTF"},{src:"/fonts/CALIBRIB.TTF",fontWeight:"bold"}]}),d.Font.register({family:"Times-Roman",fonts:[{src:"/fonts/times/TIMES.TTF"},{src:"/fonts/times/TIMESBD.TTF",fontWeight:"bold"}]})},4085:(e,t,a)=>{"use strict";a.d(t,{$:()=>l});var s=a(5155);a(2115);var r=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,...d}=e,c=l?r.DX:"button";return(0,s.jsx)(c,{"data-slot":"button",className:(0,i.cn)(o({variant:a,size:n,className:t})),...d})}},7358:(e,t,a)=>{Promise.resolve().then(a.bind(a,920))},9602:(e,t,a)=>{"use strict";a.d(t,{cn:()=>n});var s=a(3463),r=a(9795);function n(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];return(0,r.QP)((0,s.$)(t))}}},e=>{var t=t=>e(e.s=t);e.O(0,[792,247,788,746,251,501,941,186,441,587,358],()=>t(7358)),_N_E=e.O()}]);