1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[714],{3622:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/clients/create",function(){return a(1251)}])},6687:function(e,t,a){"use strict";var s=a(5893);a(7294);var n=a(1664),l=a.n(n);t.Z=e=>{let{parents:t,activePage:a}=e;return(0,s.jsxs)("div",{className:"mb-6",children:[t.map((e,t)=>(0,s.jsxs)("span",{children:[(0,s.jsx)(l(),{href:e.path,className:"text-blue-500 hover:text-blue-700",children:e.name}),(0,s.jsx)("span",{className:"mx-2 text-gray-400",children:"/"})]},t)),(0,s.jsx)("span",{className:"text-gray-600",children:a})]})}},1251:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return x}});var s=a(5893),n=a(7294),l=a(1163),r=a(7811),i=a(6100),o=a(9451),c=a(971),d=a(890),u=a(9008),h=a.n(u);a(1664);var m=a(6687);function x(){let[e,t]=(0,n.useState)(null),[a,u]=(0,n.useState)(""),[x,p]=(0,n.useState)(""),[b,g]=(0,n.useState)(""),[f,j]=(0,n.useState)(""),w=(0,l.useRouter)();(0,n.useEffect)(()=>(0,o.Aj)(r.I,e=>{e?t(e):(t(null),w.push("/login"))}),[w]);let N=async e=>{e.preventDefault();try{let e=await (0,i.ET)((0,i.hJ)(r.db,"clients"),{name:a,email:x,phone:b,website:f,createdAt:new Date});console.log("Document written with ID: ",e.id),w.push("/clients")}catch(e){console.error("Error adding document: ",e)}};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(h(),{children:[(0,s.jsx)("title",{children:"Create Client | Voltix Logbook"}),(0,s.jsx)("meta",{name:"description",content:"Get an overview"})]}),(0,s.jsxs)("div",{className:"flex bg-gray-100",children:[(0,s.jsx)(d.Z,{}),(0,s.jsxs)("div",{className:"flex-grow",children:[(0,s.jsx)(c.Z,{}),(0,s.jsx)("div",{className:"py-6",children:(0,s.jsxs)("div",{className:"container mx-auto max-w-full px-4",children:[(0,s.jsx)(m.Z,{parents:[{name:"Dashboard",path:"/"},{name:"Clients",path:"/clients"}],activePage:"Create Client"}),(0,s.jsxs)("div",{className:"bg-white rounded-lg shadow-md p-6",children:[(0,s.jsx)("div",{className:"flex items-center justify-between mb-6",children:(0,s.jsx)("h1",{className:"text-3xl font-bold",children:"Create Client"})}),(0,s.jsxs)("form",{onSubmit:N,children:[(0,s.jsxs)("div",{className:"mb-4",children:[(0,s.jsx)("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"name",children:"Name"}),(0,s.jsx)("input",{className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline",id:"name",type:"text",value:a,onChange:e=>u(e.target.value),required:!0})]}),(0,s.jsxs)("div",{className:"mb-4",children:[(0,s.jsx)("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"email",children:"Email"}),(0,s.jsx)("input",{className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline",id:"email",type:"email",value:x,onChange:e=>p(e.target.value),required:!0})]}),(0,s.jsxs)("div",{className:"mb-4",children:[(0,s.jsx)("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"phone",children:"Phone"}),(0,s.jsx)("input",{className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline",id:"phone",type:"tel",value:b,onChange:e=>g(e.target.value),required:!0})]}),(0,s.jsxs)("div",{className:"mb-4",children:[(0,s.jsx)("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"website",children:"Website"}),(0,s.jsx)("input",{className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline",id:"website",type:"url",value:f,onChange:e=>j(e.target.value),required:!0})]}),(0,s.jsx)("button",{className:"bg-blue-500 hover:bg-blue-700 text-white py-2 px-4 rounded mt-2",type:"submit",children:"Create Client"})]})]})]})})]})]})]})}}},function(e){e.O(0,[675,64,388,774,888,179],function(){return e(e.s=3622)}),_N_E=e.O()}]);
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.