@@ -19,6 +19,7 @@ import { Controller, useForm } from "react-hook-form";
19
19
import { z } from "zod" ;
20
20
import { InputTags } from "./InputTags" ;
21
21
import { T } from "./ui/Typography" ;
22
+ import { Checkbox } from "./ui/checkbox" ;
22
23
23
24
const MotionCard = motion ( Card ) ;
24
25
@@ -27,6 +28,7 @@ const createProjectFormSchema = z.object({
27
28
repository : z . number ( ) . int ( ) . positive ( "Please select a repository" ) ,
28
29
terraformDir : z . string ( ) . min ( 1 , "Terraform working directory is required" ) ,
29
30
labels : z . array ( z . string ( ) ) ,
31
+ managedState : z . boolean ( ) . default ( true ) ,
30
32
} ) ;
31
33
32
34
type CreateProjectFormData = z . infer < typeof createProjectFormSchema > ;
@@ -50,6 +52,7 @@ export default function CreateProjectForm({ organizationId, repositories }: Crea
50
52
name : "" ,
51
53
repository : repositories [ 0 ] ?. id || 0 ,
52
54
terraformDir : "" ,
55
+ managedState : true ,
53
56
labels : [ ] ,
54
57
} ,
55
58
} ) ;
@@ -62,6 +65,7 @@ export default function CreateProjectForm({ organizationId, repositories }: Crea
62
65
name : data . name ,
63
66
slug,
64
67
repoId : data . repository ,
68
+ managedState : data . managedState ,
65
69
terraformWorkingDir : data . terraformDir ,
66
70
labels : data . labels ,
67
71
} ) ;
@@ -268,6 +272,20 @@ export default function CreateProjectForm({ organizationId, repositories }: Crea
268
272
</ CardHeader >
269
273
< CardContent >
270
274
< div className = "space-y-4" >
275
+ < div className = "flex items-center space-x-2" >
276
+ < Controller
277
+ name = "managedState"
278
+ control = { control }
279
+ render = { ( { field } ) => (
280
+ < Checkbox
281
+ id = "managedState"
282
+ checked = { field . value }
283
+ onCheckedChange = { field . onChange }
284
+ />
285
+ ) }
286
+ />
287
+ < Label htmlFor = "managedState" > Managed State</ Label >
288
+ </ div >
271
289
< div >
272
290
< Label htmlFor = "labels" > Labels</ Label >
273
291
< Controller
0 commit comments