PageSourceSearch

https://protum.ai/assets/create-team-CnFCU1WJ.js

js protum.ai collected 2026-10-05 12:27:26 UTC 7,369 bytes, 1 lines download raw bytes

1import{h as S,i as k,g as F,j as e,B as r,q as A,e as I}from"./index-CTxC1O8w.js";import{u as P}from"./index.esm-XsRZnVI1.js";import{t as B,z as o}from"./index-BiX3CWx3.js";import{u as D}from"./useMutation-9_3NnjcK.js";import{a as q}from"./schema-CrWiVR-F.js";import{C as l,b as c,c as m,a as d,d as L}from"./card-Rhez1T_e.js";import{F as R,a as u,b as x,c as p,d as h,f as j,e as b}from"./form-B2230Ta1.js";import{I as V}from"./input-DPFc9ddj.js";import{T as M}from"./textarea-DIaHDGKs.js";import{S as Y,a as E,b as H,c as O,d as g}from"./select-DNtxRcIj.js";import{N as f}from"./navigation-7y7MK8f6.js";import{B as y}from"./building-2-EmiD0J1t.js";import{C as U}from"./circle-alert-DOmhCbSg.js";import{U as z}from"./users-qTkJNjh4.js";import{A as K}from"./arrow-right-CZb0pcoP.js";import"./label-C83VITks.js";import"./index-C4MJ8_fM.js";import"./chevron-down-DbB0SJdk.js";import"./sheet-Bfhoq8rl.js";import"./index-DrFu3AUE.js";import"./chevron-right-B-Xh1Kj0.js";import"./user-uXymXJL8.js";import"./activity-9bw9dUgZ.js";import"./book-open-B_mjUOoC.js";import"./award-C3B4bBRw.js";import"./circle-check-big-CC8DizkC.js";import"./file-text-EZBh_ljz.js";import"./log-out-7ezYOx51.js";const Q=q.extend({name:o.string().min(3,"Team name must be at least 3 characters"),description:o.string().optional(),purpose:o.string().optional()});function ve(){const[,a]=S(),{toast:N}=k(),{user:t,isAuthenticated:v,isLoading:C}=F(),w=(t==null?void 0:t.subscriptionType)==="corporate"||(t==null?void 0:t.subscriptionType)==="business",n=P({resolver:B(Q),defaultValues:{name:"",description:"",purpose:"assessment"}}),i=D({mutationFn:async s=>(await I("POST","/api/teams",s)).json(),onSuccess:s=>{A.invalidateQueries({queryKey:["/api/teams"]}),N({title:"Team Created!",description:"Your team has been created successfully. You can now invite members."}),a(`/teams/${s.id}`)},onError:s=>{N({title:"Error",description:s.message||"Failed to create team",variant:"destructive"})}}),T=s=>{i.mutate(s)};return C?e.jsxs(e.Fragment,{children:[e.jsx(f,{}),e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto mb-4"}),e.jsx("p",{className:"text-muted-foreground",children:"Loading..."})]})})]}):v?w?e.jsx("div",{className:"min-h-screen bg-gradient-to-br from-blue-50 via-white to-green-50 dark:from-gray-900 dark:via-gray-800 dark:to-gray-900",children:e.jsx("div",{className:"container mx-auto px-4 py-12",children:e.jsxs("div",{className:"max-w-2xl mx-auto",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-blue-100 dark:bg-blue-900 mb-4",children:e.jsx(z,{className:"w-8 h-8 text-blue-600 dark:text-blue-400"})}),e.jsx("h1",{className:"text-4xl font-bold mb-3 bg-gradient-to-r from-blue-600 to-green-600 bg-clip-text text-transparent",children:"Create Your Team"}),e.jsx("p",{className:"text-lg text-gray-600 dark:text-gray-300",children:"Start your collaborative AI maturity assessment journey"})]}),e.jsxs(l,{className:"border-2 border-gray-200 dark:border-gray-700 shadow-xl",children:[e.jsxs(c,{children:[e.jsxs(m,{className:"flex items-center gap-2",children:[e.jsx(y,{className:"w-5 h-5"}),"Team Information"]}),e.jsx(L,{children:"Set up your team to enable collaborative assessments and track progress together"})]}),e.jsx(d,{children:e.jsx(R,{...n,children:e.jsxs("form",{onSubmit:n.handleSubmit(T),className:"space-y-6",children:[e.jsx(u,{control:n.control,name:"name",render:({field:s})=>e.jsxs(x,{children:[e.jsx(p,{children:"Team Name"}),e.jsx(h,{children:e.jsx(V,{placeholder:"e.g., Product Development Team","data-testid":"input-team-name",...s})}),e.jsx(j,{children:"Choose a clear name that identifies your team"}),e.jsx(b,{})]})}),e.jsx(u,{control:n.control,name:"description",render:({field:s})=>e.jsxs(x,{children:[e.jsx(p,{children:"Description (Optional)"}),e.jsx(h,{children:e.jsx(M,{placeholder:"Describe your team's focus and goals...",className:"min-h-[100px]","data-testid":"input-team-description",...s})}),e.jsx(j,{children:"Help team members understand the team's purpose and objectives"}),e.jsx(b,{})]})}),e.jsx(u,{control:n.control,name:"purpose",render:({field:s})=>e.jsxs(x,{children:[e.jsx(p,{children:"Team Purpose"}),e.jsxs(Y,{onValueChange:s.onChange,defaultValue:s.value,children:[e.jsx(h,{children:e.jsx(E,{"data-testid":"select-team-purpose",children:e.jsx(H,{placeholder:"Select team purpose"})})}),e.jsxs(O,{children:[e.jsx(g,{value:"assessment",children:"AI Maturity Assessment"}),e.jsx(g,{value:"project",children:"Project Team"}),e.jsx(g,{value:"department",children:"Department"})]})]}),e.jsx(j,{children:"Select the primary purpose of this team"}),e.jsx(b,{})]})}),e.jsxs("div",{className:"flex gap-3 pt-4",children:[e.jsx(r,{type:"button",variant:"outline",onClick:()=>
1a("/dashboard"),className:"flex-1","data-testid":"button-cancel",children:"Cancel"}),e.jsx(r,{type:"submit",disabled:i.isPending,className:"flex-1 bg-gradient-to-r from-blue-600 to-green-600 hover:from-blue-700 hover:to-green-700","data-testid":"button-create-team",children:i.isPending?"Creating...":e.jsxs(e.Fragment,{children:["Create Team",e.jsx(K,{className:"w-4 h-4 ml-2"})]})})]})]})})})]}),e.jsx("div",{className:"mt-6 text-center text-sm text-gray-600 dark:text-gray-400",children:e.jsx("p",{children:"After creating your team, you'll be able to invite members and start collaborative assessments"})})]})})}):e.jsxs(e.Fragment,{children:[e.jsx(f,{}),e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:e.jsxs(l,{className:"max-w-md w-full",children:[e.jsxs(c,{className:"text-center",children:[e.jsx("div",{className:"mx-auto w-16 h-16 bg-orange-100 rounded-full flex items-center justify-center mb-4",children:e.jsx(U,{className:"w-8 h-8 text-orange-600"})}),e.jsx(m,{className:"text-2xl",children:"Business Account Required"})]}),e.jsxs(d,{className:"text-center space-y-4",children:[e.jsx("p",{className:"text-muted-foreground",children:"Creating teams is only available for business accounts. Please upgrade to a business plan to access team creation and collaboration features."}),e.jsx(r,{onClick:()=>a("/enterprise?tab=business"),className:"w-full",children:"View Business Plans"}),e.jsx(r,{variant:"outline",onClick:()=>a("/dashboard"),className:"w-full",children:"Continue to Your Dashboard"}),e.jsx(r,{variant:"ghost",onClick:()=>a("/compass"),className:"w-full",children:"Take Individual Assessment"})]})]})})]}):e.jsxs(e.Fragment,{children:[e.jsx(f,{}),e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:e.jsxs(l,{className:"max-w-md w-full",children:[e.jsxs(c,{className:"text-center",children:[e.jsx("div",{className:"mx-auto w-16 h-16 bg-primary/10 rounded-full flex items-center justify-center mb-4",children:e.jsx(y,{className:"w-8 h-8 text-primary"})}),e.jsx(m,{className:"text-2xl",children:"Sign In Required"})]}),e.jsxs(d,{className:"text-center space-y-4",children:[e.jsx("p",{className:"text-muted-foreground",children:"Please sign in to create a team."}),e.jsx(r,{onClick:()=>a("/login"),className:"w-full",children:"Sign In"})]})]})})]})}export{ve 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.