1- " use client" ;
1+ ' use client'
22
3- import * as React from " react" ;
4- import { Button } from " @/components/ui/button" ;
5- import Link from " next/link" ;
6- import { toast } from " sonner" ;
3+ import * as React from ' react'
4+ import { Button } from ' @/components/ui/button'
5+ import Link from ' next/link'
6+ import { toast } from ' sonner'
77import {
88 Dialog ,
99 DialogContent ,
@@ -12,7 +12,7 @@ import {
1212 DialogHeader ,
1313 DialogTitle ,
1414 DialogTrigger ,
15- } from " @/components/ui/dialog" ;
15+ } from ' @/components/ui/dialog'
1616import {
1717 Form ,
1818 FormControl ,
@@ -21,22 +21,22 @@ import {
2121 FormItem ,
2222 FormLabel ,
2323 FormMessage ,
24- } from " @/components/ui/form" ;
25- import { Input } from " @/components/ui/input" ;
26- import { DateFormatter } from " react-day-picker" ;
27- import { CalendarIcon } from " @radix-ui/react-icons" ;
28- import { cn } from " @/lib/utils" ;
29- import { format } from " date-fns" ;
30- import { Calendar } from " @/components/ui/calendar" ;
24+ } from ' @/components/ui/form'
25+ import { Input } from ' @/components/ui/input'
26+ import { DateFormatter } from ' react-day-picker'
27+ import { CalendarIcon } from ' @radix-ui/react-icons'
28+ import { cn } from ' @/lib/utils'
29+ import { format } from ' date-fns'
30+ import { Calendar } from ' @/components/ui/calendar'
3131import {
3232 Popover ,
3333 PopoverContent ,
3434 PopoverTrigger ,
35- } from " @/components/ui/popover" ;
36- import { useForm } from " react-hook-form" ;
37- import { zodResolver } from " @hookform/resolvers/zod" ;
38- import * as z from " zod" ;
39- import { createOnboardingWorkflow } from " @/app/dashboard/actions" ;
35+ } from ' @/components/ui/popover'
36+ import { useForm } from ' react-hook-form'
37+ import { zodResolver } from ' @hookform/resolvers/zod'
38+ import * as z from ' zod'
39+ import { createOnboardingWorkflow } from ' @/app/dashboard/actions'
4040
4141// `app/dashboard/page.tsx` is the UI for the `/dashboard` URL
4242export default function Page ( ) {
@@ -50,70 +50,70 @@ export default function Page() {
5050 </ Link >
5151 </ div >
5252 </ div >
53- ) ;
53+ )
5454}
5555
5656const seasonEmoji : Record < string , string > = {
57- winter : "⛄️" ,
58- spring : "🌸" ,
59- summer : "🌻" ,
60- autumn : "🍂" ,
61- } ;
57+ winter : '⛄️' ,
58+ spring : '🌸' ,
59+ summer : '🌻' ,
60+ autumn : '🍂' ,
61+ }
6262
6363const getSeason = ( month : Date ) : string => {
64- const monthNumber = month . getMonth ( ) ;
65- if ( monthNumber >= 0 && monthNumber < 3 ) return " winter" ;
66- if ( monthNumber >= 3 && monthNumber < 6 ) return " spring" ;
67- if ( monthNumber >= 6 && monthNumber < 9 ) return " summer" ;
68- else return " autumn" ;
69- } ;
64+ const monthNumber = month . getMonth ( )
65+ if ( monthNumber >= 0 && monthNumber < 3 ) return ' winter'
66+ if ( monthNumber >= 3 && monthNumber < 6 ) return ' spring'
67+ if ( monthNumber >= 6 && monthNumber < 9 ) return ' summer'
68+ else return ' autumn'
69+ }
7070
7171const formatCaption : DateFormatter = ( month , options ) => {
72- const season = getSeason ( month ) ;
72+ const season = getSeason ( month )
7373 return (
7474 < >
7575 < span role = "img" aria-label = { season } >
7676 { seasonEmoji [ season ] }
77- </ span > { " " }
78- { format ( month , " LLLL" , { locale : options ?. locale } ) }
77+ </ span > { ' ' }
78+ { format ( month , ' LLLL' , { locale : options ?. locale } ) }
7979 </ >
80- ) ;
81- } ;
80+ )
81+ }
8282
8383const formSchema = z . object ( {
8484 orgName : z . string ( ) . min ( 2 , {
85- message : " Organization name must be at least 2 characters." ,
85+ message : ' Organization name must be at least 2 characters.' ,
8686 } ) ,
8787 profileName : z . string ( ) . min ( 2 , {
88- message : " User display name must be at least 2 characters." ,
88+ message : ' User display name must be at least 2 characters.' ,
8989 } ) ,
9090 startDate : z . date ( {
91- required_error : " Please select a date" ,
91+ required_error : ' Please select a date' ,
9292 invalid_type_error : "That's not a date!" ,
9393 } ) ,
9494 endDate : z . date ( {
95- required_error : " Please select a date" ,
95+ required_error : ' Please select a date' ,
9696 invalid_type_error : "That's not a date!" ,
9797 } ) ,
98- } ) ;
98+ } )
9999
100100export function CreateWorkflowDialog ( ) {
101101 const form = useForm < z . infer < typeof formSchema > > ( {
102102 resolver : zodResolver ( formSchema ) ,
103- } ) ;
103+ } )
104104
105105 async function onSubmit ( values : z . infer < typeof formSchema > ) {
106106 // Do something with the form values.
107107 // ✅ This will be type-safe and validated.
108- console . log ( values ) ;
109- toast ( " form submit" + JSON . stringify ( values ) ) ;
108+ console . log ( values )
109+ toast ( ' form submit' + JSON . stringify ( values ) )
110110 const response = await createOnboardingWorkflow ( {
111111 orgName : values . orgName ,
112112 profileName : values . profileName ,
113113 start : values . startDate ,
114114 end : values . startDate ,
115- } ) ;
116- toast ( response . toJsonString ( ) ) ;
115+ } )
116+ toast ( response . toJsonString ( ) )
117117 }
118118
119119 return (
@@ -173,14 +173,14 @@ export function CreateWorkflowDialog() {
173173 < Popover >
174174 < PopoverTrigger asChild >
175175 < Button
176- variant = { " outline" }
176+ variant = { ' outline' }
177177 className = { cn (
178- " pl-3 text-left font-normal" ,
179- ! field . value && " text-muted-foreground" ,
178+ ' pl-3 text-left font-normal' ,
179+ ! field . value && ' text-muted-foreground' ,
180180 ) }
181181 >
182182 { field . value ? (
183- format ( field . value , " yyyy-MM-dd" )
183+ format ( field . value , ' yyyy-MM-dd' )
184184 ) : (
185185 < span className = "pr-1" > Pick a date</ span >
186186 ) }
@@ -218,14 +218,14 @@ export function CreateWorkflowDialog() {
218218 < Popover >
219219 < PopoverTrigger asChild >
220220 < Button
221- variant = { " outline" }
221+ variant = { ' outline' }
222222 className = { cn (
223- " pl-3 text-left font-normal" ,
224- ! field . value && " text-muted-foreground" ,
223+ ' pl-3 text-left font-normal' ,
224+ ! field . value && ' text-muted-foreground' ,
225225 ) }
226226 >
227227 { field . value ? (
228- format ( field . value , " yyyy-MM-dd" )
228+ format ( field . value , ' yyyy-MM-dd' )
229229 ) : (
230230 < span className = "pr-1" > Pick a date</ span >
231231 ) }
@@ -259,5 +259,5 @@ export function CreateWorkflowDialog() {
259259 </ Form >
260260 </ DialogContent >
261261 </ Dialog >
262- ) ;
262+ )
263263}
0 commit comments