(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[495],{7572:function(e,r,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/register",function(){return a(1807)}])},1807:function(e,r,a){"use strict";a.r(r),a.d(r,{default:function(){return n}});var t=a(5893),s=a(7294),d=a(1664),i=a.n(d);function l(){let[e,r]=(0,s.useState)(""),[a,d]=(0,s.useState)(""),[l,n]=(0,s.useState)(""),o=async t=>{t.preventDefault();let s=document.querySelector(".submitMessage"),i=document.querySelector(".errorMessage"),o={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e,email:a,password:l})};try{let c=await fetch("".concat("https://api.trsondakika.com/api","/UserRegister"),o),u=await c.json();r(""),d(""),n(""),u.message.email||(s.innerHTML='<div class="bg-green-400  text-white mt-4 py-2 px-4  ">'.concat(u.message,"</div>")),u.message.email&&(i.innerHTML='<div class=" bg-red-400  text-white mt-4 py-2 px-4  ">'.concat(u.message.email[0],"</div>"))}catch(g){console.log(g)}};return(0,t.jsx)("div",{children:(0,t.jsx)("section",{class:"bg-gray-50 dark:bg-gray-900",children:(0,t.jsx)("div",{class:"flex flex-col items-center justify-center px-6 py-8 mx-auto md:h-screen lg:py-0",children:(0,t.jsx)("div",{class:"w-full bg-white rounded-lg shadow dark:border md:mt-0 sm:max-w-md xl:p-0 dark:bg-gray-800 dark:border-gray-700",children:(0,t.jsxs)("div",{class:"p-6 space-y-4 md:space-y-6 sm:p-8",children:[(0,t.jsx)("h1",{class:"text-xl font-bold leading-tight tracking-tight text-gray-900 md:text-2xl dark:text-white",children:"Kayıt Ol"}),(0,t.jsxs)("form",{class:"space-y-4 md:space-y-6",onSubmit:o,children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{for:"name",class:"block mb-2 text-sm font-medium text-gray-900 dark:text-white",children:"Ad Soyad"}),(0,t.jsx)("input",{type:"text",id:"name",value:e,onChange:e=>r(e.target.value),class:"bg-gray-50 border border-gray-300 text-gray-900 sm:text-sm rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",required:""})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{for:"email",class:"block mb-2 text-sm font-medium text-gray-900 dark:text-white",children:"Email Adresi"}),(0,t.jsx)("input",{type:"email",id:"email",value:a,onChange:e=>d(e.target.value),class:"bg-gray-50 border border-gray-300 text-gray-900 sm:text-sm rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",required:""}),(0,t.jsx)("p",{className:"errorMessage block mb-2"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{for:"password",class:"block mb-2 text-sm font-medium text-gray-900 dark:text-white",children:"Şifre"}),(0,t.jsx)("input",{type:"password",id:"password",value:l,onChange:e=>n(e.target.value),class:"bg-gray-50 border border-gray-300 text-gray-900 sm:text-sm rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500",required:""})]}),(0,t.jsx)("p",{className:"submitMessage block mb-2 "}),(0,t.jsx)("button",{type:"submit",class:"w-full text-white bg-[#0f172a] hover:bg-primary-700 focus:ring-4 focus:outline-none focus:ring-primary-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-primary-600 dark:hover:bg-primary-700 dark:focus:ring-primary-800",children:"Kayıt Ol"}),(0,t.jsxs)("p",{className:"text-sm font-light text-gray-500 dark:text-gray-400",children:["Hesabım var  ",(0,t.jsx)(i(),{href:"login",className:"font-medium text-primary-600 hover:underline dark:text-primary-500",children:"Giriş Yap"})]})]})]})})})})})}function n(){return(0,t.jsx)("div",{children:(0,t.jsx)(l,{})})}}},function(e){e.O(0,[774,888,179],function(){return e(e.s=7572)}),_N_E=e.O()}]);