PageSourceSearch

https://sinema.se/assets/GigRegister-Dme3rdQ0.js

js sinema.se collected 2026-10-10 00:16:07 UTC 3,520 bytes, 1 lines download raw bytes

1import{a as B,c as T,b as V,r as a,j as e,W as p,n as x,J as D,X as l,B as E}from"./index-CA3QGsxR.js";import{u as G}from"./useGigProfile-CfnQ-PT2.js";import{L as r}from"./label-r4ErGNGg.js";import{T as P}from"./textarea-OprfJiEU.js";import{C as W,a as _,b as A,d as K}from"./card-BEURuW3Y.js";import{C as j}from"./checkbox-D4h0txU1.js";import"./useMutation-nSnpdATf.js";import"./index-CgJQGoyb.js";function Q(){const{user:f}=B(),{isGigger:v,isLoading:N,register:b,isRegistering:c}=G(),k=T(),{toast:o}=V(),[i,C]=a.useState(""),[m,y]=a.useState(""),[d,S]=a.useState(""),[g,w]=a.useState(""),[u,R]=a.useState(!0),[h,F]=a.useState(!0);if(!f)return e.jsx(p,{to:"/logga-in",replace:!0});if(N)return e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:e.jsx(x,{className:"w-8 h-8 animate-spin text-primary"})});if(v)return e.jsx(p,{to:"/gig",replace:!0});const t=[];u&&t.push("cleaning"),h&&t.push("restocking");const L=async s=>{if(s.preventDefault(),!(!i.trim()||t.length===0))try{await b({display_name:i.trim(),phone:m.trim()||null,bio:d.trim()||null,preferred_areas:g.split(",").map(n=>n.trim()).filter(Boolean),available_categories:t}),o({title:"Registrering klar! 🎉",description:"Välkommen som gigger."}),k("/gig")}catch(n){o({title:"Något gick fel",description:n instanceof Error?n.message:"Försök igen",variant:"destructive"})}};return e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center px-4",children:e.jsxs(W,{className:"w-full max-w-md bg-card border-border",children:[e.jsxs(_,{className:"text-center",children:[e.jsx(D,{className:"w-10 h-10 mx-auto text-primary mb-2"}),e.jsx(A,{className:"text-2xl",children:"Bli gigger"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Registrera dig för att ta uppdrag"})]}),e.jsx(K,{children:e.jsxs("form",{onSubmit:L,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(r,{htmlFor:"name",children:"Visningsnamn *"}),e.jsx(l,{id:"name",value:i,onChange:s=>C(s.target.value),placeholder:"Ditt namn",required:!0,maxLength:100})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(r,{htmlFor:"phone",children:"Telefonnummer"}),e.jsx(l,{id:"phone",value:m,onChange:s=>y(s.target.value),placeholder:"070-123 45 67",maxLength:20})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(r,{htmlFor:"bio",children:"Kort om dig"}),e.jsx(P,{id:"bio",value:d,onChange:s=>S(s.target.value),placeholder:"Berätta lite om dig själv...",rows:3,maxLength:500})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(r,{htmlFor:"areas",children:"Områden (kommaseparerat)"}),e.jsx(l,{id:"areas",value:g,onChange:s=>w(s.target.value),placeholder:"Södermalm, Kungsholmen, Vasastan"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(r,{children:"Vilka uppdrag vill du ta?"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(j,{id:"cleaning",checked:u,onCheckedChange:s=>R(!!s)}),e.jsx("label",{htmlFor:"cleaning",className:"text-sm font-medium cursor-pointer",children:"🧹 Städuppdrag"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(j,{id:"restocking",checked:h,onCheckedChange:s=>F(!!s)}),e.jsx("label",{htmlFor:"restocking",className:"text-sm font-medium cursor-pointer",children:"📦 Påfyllningsuppdrag"})]})]}),e.jsxs(E,{type:"submit",className:"w-full",disabled:c||!i.trim()||t.length===0,children:[c&&e.jsx(x,{className:"w-4 h-4 mr-2 animate-spin"}),"Registrera mig"]})]})})]})})}export{Q as default};

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.