@@ -23,8 +23,10 @@ import { useForm } from '@tuturuuu/ui/hooks/use-form';
23
23
import { toast } from '@tuturuuu/ui/hooks/use-toast' ;
24
24
import { Input } from '@tuturuuu/ui/input' ;
25
25
import { zodResolver } from '@tuturuuu/ui/resolvers' ;
26
+ import { Separator } from '@tuturuuu/ui/separator' ;
26
27
import { cn } from '@tuturuuu/utils/format' ;
27
28
import dayjs from 'dayjs' ;
29
+ import { MapPin , Sparkles } from 'lucide-react' ;
28
30
import { useTranslations } from 'next-intl' ;
29
31
import { useRouter } from 'next/navigation' ;
30
32
import { useState } from 'react' ;
@@ -48,6 +50,7 @@ const FormSchema = z.object({
48
50
dates : z . array ( z . string ( ) ) . optional ( ) ,
49
51
is_public : z . boolean ( ) . optional ( ) ,
50
52
ws_id : z . string ( ) . optional ( ) ,
53
+ where_to_meet : z . boolean ( ) . optional ( ) , // <-- Added field
51
54
} ) ;
52
55
53
56
const convertToTimetz = (
@@ -61,7 +64,6 @@ const convertToTimetz = (
61
64
export default function CreatePlanDialog ( { plan } : Props ) {
62
65
const t = useTranslations ( 'meet-together' ) ;
63
66
const router = useRouter ( ) ;
64
-
65
67
const [ isOpened , setIsOpened ] = useState ( false ) ;
66
68
const [ creating , setCreating ] = useState ( false ) ;
67
69
@@ -76,17 +78,16 @@ export default function CreatePlanDialog({ plan }: Props) {
76
78
?. map ( ( date ) => dayjs ( date ) . format ( 'YYYY-MM-DD' ) ) ,
77
79
is_public : true ,
78
80
ws_id : plan . wsId ,
81
+ where_to_meet : false , // <-- Default value
79
82
} ,
80
83
} ) ;
81
84
82
85
const isValid = form . formState . isValid ;
83
86
const isSubmitting = form . formState . isSubmitting ;
84
-
85
87
const disabled = ! isValid || isSubmitting ;
86
88
87
89
const handleSubmit = async ( ) => {
88
90
setCreating ( true ) ;
89
-
90
91
const data = form . getValues ( ) ;
91
92
let hasError = false ;
92
93
@@ -173,39 +174,16 @@ export default function CreatePlanDialog({ plan }: Props) {
173
174
{ t ( 'create_plan' ) }
174
175
</ div >
175
176
</ button >
176
- { /* <button
177
- className={`${
178
-
179
- } group relative inline-flex w-full`}
180
- onClick={() => setIsOpened(true)}
181
- disabled={missingFields || creating}
182
- >
183
- <div
184
- className={cn(
185
- 'from-dynamic-light-red via-dynamic-light-pink to-dynamic-light-blue bg-linear-to-r',
186
- missingFields || creating
187
- ? 'opacity-10'
188
- : 'group-hover:opacity-30',
189
- 'absolute rounded-lg blur transition-all duration-500'
190
- )}
191
- />
192
- <div
193
- className={`from-dynamic-light-red via-dynamic-light-pink to-dynamic-light-blue relative inline-flex w-full items-center justify-center rounded-lg bg-linear-to-r px-8 py-2 font-bold text-white transition-all md:text-lg`}
194
- >
195
- {t('create_plan')}
196
- </div>
197
- </button> */ }
198
177
</ DialogTrigger >
199
- < DialogContent className = "sm:max-w-[425px ]" >
178
+ < DialogContent className = "sm:max-w-[500px ]" >
200
179
< DialogHeader >
201
180
< DialogTitle > { t ( 'new_plan' ) } </ DialogTitle >
202
181
< DialogDescription > { t ( 'new_plan_desc' ) } </ DialogDescription >
203
182
</ DialogHeader >
204
-
205
183
< Form { ...form } >
206
184
< form
207
185
onSubmit = { form . handleSubmit ( handleSubmit ) }
208
- className = "space-y-3 "
186
+ className = "space-y-4 "
209
187
>
210
188
< FormField
211
189
control = { form . control }
@@ -221,7 +199,89 @@ export default function CreatePlanDialog({ plan }: Props) {
221
199
) }
222
200
/>
223
201
224
- < DialogFooter >
202
+ < Separator className = "my-6" />
203
+
204
+ { /* Extra Features Section */ }
205
+ < div className = "space-y-4" >
206
+ < div className = "flex items-center gap-2" >
207
+ < Sparkles className = "h-4 w-4 text-purple-500" />
208
+ < h3 className = "text-sm font-semibold text-foreground" >
209
+ Extra Features
210
+ </ h3 >
211
+ </ div >
212
+ < p className = "text-xs text-muted-foreground" >
213
+ Enhance your meeting plan with additional features to make
214
+ coordination easier.
215
+ </ p >
216
+
217
+ { /* Where-to-meet feature */ }
218
+ < FormField
219
+ control = { form . control }
220
+ name = "where_to_meet"
221
+ render = { ( { field } ) => (
222
+ < FormItem >
223
+ < div
224
+ className = "cursor-pointer rounded-lg border border-border bg-muted/30 p-4 transition-colors hover:bg-muted/50"
225
+ onClick = { ( ) => field . onChange ( ! field . value ) }
226
+ >
227
+ < div className = "flex items-start space-x-3" >
228
+ < FormControl >
229
+ < input
230
+ type = "checkbox"
231
+ id = "where_to_meet"
232
+ checked = { field . value }
233
+ onChange = { field . onChange }
234
+ className = "mt-1 h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500"
235
+ />
236
+ </ FormControl >
237
+ < div className = "flex-1 space-y-2" >
238
+ < div className = "flex items-center gap-2" >
239
+ < MapPin className = "h-4 w-4 text-blue-500" />
240
+ < FormLabel
241
+ htmlFor = "where_to_meet"
242
+ className = "mb-0 cursor-pointer font-medium text-foreground"
243
+ onClick = { ( e ) => e . stopPropagation ( ) }
244
+ >
245
+ Where TuMeet?
246
+ </ FormLabel >
247
+ </ div >
248
+ < p className = "text-xs leading-relaxed text-muted-foreground" >
249
+ Enable location suggestions and voting. Participants
250
+ can propose meeting locations and vote on their
251
+ preferred spots, making it easier to find the
252
+ perfect place for everyone.
253
+ </ p >
254
+ < div className = "flex items-center gap-1 text-xs text-blue-600" >
255
+ < span > ✨ Popular feature</ span >
256
+ </ div >
257
+ </ div >
258
+ </ div >
259
+ </ div >
260
+ < FormMessage />
261
+ </ FormItem >
262
+ ) }
263
+ />
264
+
265
+ { /* Placeholder for future features */ }
266
+ < div className = "rounded-lg border border-dashed border-border/50 bg-muted/20 p-4" >
267
+ < div className = "flex items-center justify-center text-center" >
268
+ < div className = "space-y-2" >
269
+ < div className = "flex items-center justify-center gap-2 text-muted-foreground" >
270
+ < Sparkles className = "h-4 w-4" />
271
+ < span className = "text-sm font-medium" >
272
+ More features coming soon!
273
+ </ span >
274
+ </ div >
275
+ < p className = "text-xs text-muted-foreground" >
276
+ We're working on additional features to make your
277
+ meetings even better.
278
+ </ p >
279
+ </ div >
280
+ </ div >
281
+ </ div >
282
+ </ div >
283
+
284
+ < DialogFooter className = "pt-4" >
225
285
< Button
226
286
type = "submit"
227
287
className = "w-full"
0 commit comments