PageSourceSearch

https://www.skillihire.com/assets/FreelancingPost-Cz_2Zb1_.js

js skillihire.com collected 2026-09-24 14:53:47 UTC 6,806 bytes, 1 lines download raw bytes

1import{Z as w,Y as D,r as L,j as e,I as v,a0 as u,a1 as h,a2 as j,a3 as p,a4 as d,X as M,B as T,L as V,aM as I,e as k,am as R,C as q,ap as A,aq as E,ar as U,d as O}from"./index-C6--jTPa.js";import{u as W,F as H,a,b as i,c as t,d as l,e as _,f as c,t as X}from"./form-BMtQIxa4.js";import{T as $}from"./textarea-CMbBoEE6.js";import{B as Y}from"./badge-BpH-XLTX.js";import{S as Z}from"./switch-CiPIf71S.js";import{f as z,g as G}from"./useFreelancing-BFs7pmNN.js";import{o as J,s as x,c as N,b as K}from"./types-C0BKU5gr.js";import"./label-CdYthYdK.js";const Q=J({title:x().min(10,"Title must be at least 10 characters").max(100),description:x().min(100,"Description must be at least 100 characters").max(5e3),category:x().min(1,"Please select a category"),budget_type:x(),budget_min:N.number().min(0).optional(),budget_max:N.number().min(0).optional(),duration:x().optional(),experience_level:x(),is_urgent:K()}),ee=["Web Development","Mobile Development","UI/UX Design","Data Science","AI/ML","DevOps","Blockchain","Content Writing","Marketing","Cloud","Infrastructure","Programming","Web3","Other"],se=["Less than a week","1-2 weeks","2-4 weeks","1-3 months","3-6 months","More than 6 months"],re=()=>{const{user:m}=w(),g=D(),{data:b,isLoading:S}=z(),f=G(),[y,P]=L.useState([]),n=W({resolver:X(Q),defaultValues:{title:"",description:"",category:"",budget_type:"fixed",budget_min:void 0,budget_max:void 0,duration:"",experience_level:"intermediate",is_urgent:!1}}),B=s=>{P(r=>r.includes(s)?r.filter(o=>o!==s):[...r,s])},F=async s=>{m&&(await f.mutateAsync({project:{client_id:m.id,title:s.title,description:s.description,category:s.category,budget_type:s.budget_type,budget_min:s.budget_min||null,budget_max:s.budget_max||null,duration:s.duration||null,experience_level:s.experience_level,is_urgent:s.is_urgent,is_featured:!1,status:"open"},skillIds:y}),g("/freelancing/dashboard"))},C=b==null?void 0:b.reduce((s,r)=>(s[r.category]||(s[r.category]=[]),s[r.category].push(r),s),{});return e.jsx(H,{...n,children:e.jsxs("form",{onSubmit:n.handleSubmit(F),className:"space-y-6",children:[e.jsx(a,{control:n.control,name:"title",render:({field:s})=>e.jsxs(i,{children:[e.jsx(t,{children:"Project Title"}),e.jsx(l,{children:e.jsx(v,{placeholder:"Build a responsive e-commerce website with React",...s})}),e.jsx(_,{children:"Be specific about what you need"}),e.jsx(c,{})]})}),e.jsx(a,{control:n.control,name:"description",render:({field:s})=>e.jsxs(i,{children:[e.jsx(t,{children:"Project Description"}),e.jsx(l,{children:e.jsx($,{placeholder:"Describe your project in detail. Include requirements, deliverables, and any specific technologies you want to use...",className:"min-h-[200px]",...s})}),e.jsx(c,{})]})}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsx(a,{control:n.control,name:"category",render:({field:s})=>e.jsxs(i,{children:[e.jsx(t,{children:"Category"}),e.jsxs(u,{onValueChange:s.onChange,defaultValue:s.value,children:[e.jsx(l,{children:e.jsx(h,{children:e.jsx(j,{placeholder:"Select category"})})}),e.jsx(p,{children:ee.map(r=>e.jsx(d,{value:r,children:r},r))})]}),e.jsx(c,{})]})}),e.jsx(a,{control:n.control,name:"experience_level",render:({field:s})=>e.jsxs(i,{children:[e.jsx(t,{children:"Experience Level Required"}),e.jsxs(u,{onValueChange:s.onChange,defaultValue:s.value,children:[e.jsx(l,{children:e.jsx(h,{children:e.jsx(j,{placeholder:"Select level"})})}),e.jsxs(p,{children:[e.jsx(d,{value:"beginner",children:"Beginner"}),e.jsx(d,{value:"intermediate",children:"Intermediate"}),e.jsx(d,{value:"expert",children:"Expert"})]})]}),e.jsx(c,{})]})})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsx(a,{control:n.control,name:"budget_type",render:({field:s})=>e.jsxs(i,{children:[e.jsx(t,{children:"Budget Type"}),e.jsxs(u,{onValueChange:s.onChange,defaultValue:s.value,children:[e.jsx(l,{children:e.jsx(h,{children:e.jsx(j,{placeholder:"Select type"})})}),e.jsxs(p,{children:[e.jsx(d,{value:"fixed",children:"Fixed Price"}),e.jsx(d,{value:"hourly",children:"Hourly Rate"})]})]}),e.jsx(c,{})]})}),e.jsx(a,{control:n.control,name:"budget_min",render:({field:s})=>e.jsxs(i,{children:[e.jsx(t,{children:"Min Budget ($)"}),e.jsx(l,{children:e.jsx(v,{type:"number",min:0,placeholder:"500",...s})}),e.jsx(c,{})]})}),e.jsx(a,{control:n.control,name:"budget_max",render:({field:s})=>e.jsxs(i,{children:[e.jsx(t,{children:"Max Budget ($)"}),e.jsx(l,{children:e.jsx(v,{type:"number",min:0,placeholder:"2000",...s})}),e.jsx(c,{})]})})]}),e.jsx(a,{control:n.control,name:"duration",render:({field:s})=>e.jsxs(i,{children:[e.jsx(t,{children:"Project Duration"}),e.jsxs(u,{onValueChange:s.onChange,defaultValue:s.value,children:[e.jsx(l,{children:e.jsx(h,{children:e.jsx(j,{placeholder:"Select duration"})})}),e.jsx(p,{children:se.map(r=>e.jsx(d,{value:r,children:r},r))})]}),e.jsx(c,{})]})}),e.jsxs("div",{className:"space-y-4",children:[e.jsx(t,{children:"Required Skills"}),S?e.jsx("p",{className:"text-muted-foreground text-sm",children:"Loading skills..."}):e.jsx("div",{className:"space-y-4",children:C&&Object.entries(C).map(([s,r])=>e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-muted-foreground mb-2",children:s}),e.jsx("div",{className:"flex flex-wrap gap-2",children:r==null?void 0:r.map(o=>e.jsxs(Y,{variant:y.includes(o.id)?"default":"outline",className:"cursor-pointer transition-all",onClick:()=>B(o.id),children:[o.name,y.includes(o.id)&&e.jsx(M,{className:"ml-1 h-3 w-3"})]},o.id))})]},s))})]}),e.jsx(a,{control:n.control,name:"is_urgent",render:({field:s})=>e.jsxs(i,{className:"flex flex-row items-center justify-between rounded-lg border p-4",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(t,{className:"text-base",children:"Mark as Urgent"}),e.jsx(_,{children:"Urgent projects are highlighted and appear at the top of listings"})]}),e.jsx(l,{children:e.jsx(Z,{checked:s.value,onCheckedChange:s.onChange})})]})}),e.jsxs(T,{type:"submit",className:"btn-premium w-full",disabled:f.isPending,children:[f.isPending&&e.jsx(V,{className:"mr-2 h-4 w-4 animate-spin"}),"Post Project"]})]})})},xe=()=>{const{user:m,loading:g}=w();return g?null:m?e.jsx("div",{className:"min-h-screen py-24",children:e.jsxs("div",{className:"container mx-auto px-4 lg:px-8 max-w-3xl",children:[e.jsxs(k,{to:"/freelancing",className:"inline-flex items-center text-muted-foreground hover:text-foreground mb-6",children:[e.jsx(R,{className:"h-4 w-4 mr-2"}),"Back to Marketplace"]}),e.jsxs(q,{className:"glass-card",children:[e.jsxs(A,{children:[e.jsx(E,{className:"text-2xl",children:"Post a New Project"}),e.jsx(U,{children:"Describe your project and find the perfect freelancer to bring it to life"})]}),e.jsx(O,{children:e.jsx(re,{})})]})]})}):e.jsx(I,{to:"/login",replace:!0})};export{xe 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.