Skip to content
This repository was archived by the owner on Jan 15, 2026. It is now read-only.

Commit 2c1e40f

Browse files
chore: format (#85)
1 parent afe11b7 commit 2c1e40f

File tree

10 files changed

+190
-190
lines changed

10 files changed

+190
-190
lines changed

ui/src/app/dashboard/actions.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
"use server";
1+
'use server'
22

3-
import { Timestamp } from "@bufbuild/protobuf";
4-
import { createPromiseClient } from "@connectrpc/connect";
5-
import { TemporalService } from "@buf/kevinmichaelchen_temporalapis.connectrpc_es/temporal/v1beta1/api_connect";
6-
import { createConnectTransport } from "@connectrpc/connect-web";
3+
import { Timestamp } from '@bufbuild/protobuf'
4+
import { createPromiseClient } from '@connectrpc/connect'
5+
import { TemporalService } from '@buf/kevinmichaelchen_temporalapis.connectrpc_es/temporal/v1beta1/api_connect'
6+
import { createConnectTransport } from '@connectrpc/connect-web'
77

88
const temporalClient = createPromiseClient(
99
TemporalService,
1010
createConnectTransport({
11-
baseUrl: "http://localhost:8081",
11+
baseUrl: 'http://localhost:8081',
1212
}),
13-
);
13+
)
1414

1515
export async function createOnboardingWorkflow({
1616
orgName,
1717
profileName,
1818
start,
1919
end,
2020
}: {
21-
orgName: string;
22-
profileName: string;
23-
start: Date;
24-
end: Date;
21+
orgName: string
22+
profileName: string
23+
start: Date
24+
end: Date
2525
}) {
26-
"use server";
26+
'use server'
2727
const response = await temporalClient.createOnboardingWorkflow({
2828
org: {
2929
name: orgName,
@@ -35,6 +35,6 @@ export async function createOnboardingWorkflow({
3535
profile: {
3636
name: profileName,
3737
},
38-
});
39-
return response;
38+
})
39+
return response
4040
}

ui/src/app/dashboard/page.tsx

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
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'
77
import {
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'
1616
import {
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'
3131
import {
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
4242
export default function Page() {
@@ -50,70 +50,70 @@ export default function Page() {
5050
</Link>
5151
</div>
5252
</div>
53-
);
53+
)
5454
}
5555

5656
const seasonEmoji: Record<string, string> = {
57-
winter: "⛄️",
58-
spring: "🌸",
59-
summer: "🌻",
60-
autumn: "🍂",
61-
};
57+
winter: '⛄️',
58+
spring: '🌸',
59+
summer: '🌻',
60+
autumn: '🍂',
61+
}
6262

6363
const 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

7171
const 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

8383
const 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

100100
export 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
}

ui/src/components/ui/button.tsx

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
1-
import * as React from "react"
2-
import { Slot } from "@radix-ui/react-slot"
3-
import { cva, type VariantProps } from "class-variance-authority"
1+
import * as React from 'react'
2+
import { Slot } from '@radix-ui/react-slot'
3+
import { cva, type VariantProps } from 'class-variance-authority'
44

5-
import { cn } from "@/lib/utils"
5+
import { cn } from '@/lib/utils'
66

77
const buttonVariants = cva(
8-
"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
8+
'inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50',
99
{
1010
variants: {
1111
variant: {
1212
default:
13-
"bg-primary text-primary-foreground shadow hover:bg-primary/90",
13+
'bg-primary text-primary-foreground shadow hover:bg-primary/90',
1414
destructive:
15-
"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
15+
'bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90',
1616
outline:
17-
"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
17+
'border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground',
1818
secondary:
19-
"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
20-
ghost: "hover:bg-accent hover:text-accent-foreground",
21-
link: "text-primary underline-offset-4 hover:underline",
19+
'bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80',
20+
ghost: 'hover:bg-accent hover:text-accent-foreground',
21+
link: 'text-primary underline-offset-4 hover:underline',
2222
},
2323
size: {
24-
default: "h-9 px-4 py-2",
25-
sm: "h-8 rounded-md px-3 text-xs",
26-
lg: "h-10 rounded-md px-8",
27-
icon: "h-9 w-9",
24+
default: 'h-9 px-4 py-2',
25+
sm: 'h-8 rounded-md px-3 text-xs',
26+
lg: 'h-10 rounded-md px-8',
27+
icon: 'h-9 w-9',
2828
},
2929
},
3030
defaultVariants: {
31-
variant: "default",
32-
size: "default",
31+
variant: 'default',
32+
size: 'default',
3333
},
34-
}
34+
},
3535
)
3636

3737
export interface ButtonProps
@@ -42,16 +42,16 @@ export interface ButtonProps
4242

4343
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
4444
({ className, variant, size, asChild = false, ...props }, ref) => {
45-
const Comp = asChild ? Slot : "button"
45+
const Comp = asChild ? Slot : 'button'
4646
return (
4747
<Comp
4848
className={cn(buttonVariants({ variant, size, className }))}
4949
ref={ref}
5050
{...props}
5151
/>
5252
)
53-
}
53+
},
5454
)
55-
Button.displayName = "Button"
55+
Button.displayName = 'Button'
5656

5757
export { Button, buttonVariants }

0 commit comments

Comments
 (0)