Skip to content

Commit 8f44476

Browse files
committed
formatting
1 parent 8dad5f7 commit 8f44476

File tree

9 files changed

+80
-75
lines changed

9 files changed

+80
-75
lines changed

app/classroom/[classroomId]/manage/buttons.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export default function ClassroomManagementButtons({
7777

7878
const deleteClassroomFunction = async () => {
7979
startTransition(async () => {
80-
await deleteClassroom(classroomData.id);
80+
await deleteClassroom(classroomData.id);
8181
});
8282
toast({
8383
title: "Successfully deleted classroom",
@@ -154,8 +154,11 @@ export default function ClassroomManagementButtons({
154154
</AlertDialogHeader>
155155
<AlertDialogFooter>
156156
<AlertDialogCancel>Cancel</AlertDialogCancel>
157-
<AlertDialogAction disabled={isPending} onClick={() => deleteClassroomFunction()}>
158-
{isPending && <Loader2 className="animate-spin" />} Continue
157+
<AlertDialogAction
158+
disabled={isPending}
159+
onClick={() => deleteClassroomFunction()}
160+
>
161+
{isPending && <Loader2 className="animate-spin" />} Continue
159162
</AlertDialogAction>
160163
</AlertDialogFooter>
161164
</AlertDialogContent>

app/classroom/[classroomId]/manage/page.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export default function ClassroomManagementPage() {
3838
// eslint-disable-next-line react-hooks/rules-of-hooks
3939
useEffect(() => {
4040
setStaleDataIfDeleted(structuredClone(classroomInfo));
41-
// eslint-disable-next-line react-hooks/exhaustive-deps
41+
// eslint-disable-next-line react-hooks/exhaustive-deps
4242
}, []);
4343

4444
// If the userContext is undefined still, give loading visual
@@ -58,8 +58,8 @@ export default function ClassroomManagementPage() {
5858
</div>
5959
);
6060
}
61-
}else{
62-
classToRender=classroomInfo;
61+
} else {
62+
classToRender = classroomInfo;
6363
}
6464

6565
return (

app/classroom/_components/saveClassroomDialog.tsx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,23 @@ export default function SaveClassroomDialog({
3535

3636
const saveClassroomCallback = async () => {
3737
setIsDialogOpen(false);
38-
setIsPending(true)
38+
setIsPending(true);
3939
// startTransition(async () => {
40-
const result = await optimisticUpdateCallback(newClassName);
41-
if (!result) {
42-
toast({
43-
variant: "destructive",
44-
title: `Uh oh! Something went wrong when attempting to ${actionText.toLocaleLowerCase()} the classroom.`,
45-
description: `Please refresh and try again`,
46-
});
47-
return;
48-
}
40+
const result = await optimisticUpdateCallback(newClassName);
41+
if (!result) {
4942
toast({
50-
variant: "success",
51-
title: `${capitalize(actionText)} classroom successfully!`,
43+
variant: "destructive",
44+
title: `Uh oh! Something went wrong when attempting to ${actionText.toLocaleLowerCase()} the classroom.`,
45+
description: `Please refresh and try again`,
5246
});
53-
setIsDialogOpen(false);
54-
setIsPending(false);
47+
return;
48+
}
49+
toast({
50+
variant: "success",
51+
title: `${capitalize(actionText)} classroom successfully!`,
52+
});
53+
setIsDialogOpen(false);
54+
setIsPending(false);
5555
// });
5656
return;
5757
};

app/classroom/actions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export async function deleteClassroom(classroom_id: number) {
4242
`Failed while deleting assistant from Ragflow: ${chatResponse.statusText}`
4343
);
4444
}
45-
}
45+
}
4646
// else {
4747
// // If no chat assistant, we don't want to error out
4848
// console.log("No chat assistant found for classroom when deleting");
@@ -215,7 +215,7 @@ export async function newClassroom(name: string, id: string) {
215215
const supabase = await createServiceClient();
216216
const { data, error } = await supabase
217217
.from("Classrooms")
218-
.insert([{ name: name, admin_user_id: id,archived: false }])
218+
.insert([{ name: name, admin_user_id: id, archived: false }])
219219
.select("id");
220220

221221
if (error) {

app/classroom/classroomList.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,12 @@ function ClassroomListWithContext({
296296
<CardHeader>
297297
<CardTitle>{classroom.name}</CardTitle>
298298
<CardDescription>
299-
<div className="flex flex-row gap-3">Join Code: {classroom.join_code|| <Skeleton className="h-5 w-5/12 self-center" />}</div>
299+
<div className="flex flex-row gap-3">
300+
Join Code:{" "}
301+
{classroom.join_code || (
302+
<Skeleton className="h-5 w-5/12 self-center" />
303+
)}
304+
</div>
300305
</CardDescription>
301306
</CardHeader>
302307
<CardContent>

app/classroom/join/[code]/route.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ export async function GET(
6262
return NextResponse.redirect(new URL("/classroom", request.url));
6363
}
6464
//redirect to classroom
65-
66-
const success_url = new URL("/classroom", request.url)
67-
success_url.searchParams.append("join_success",classroom.id.toString())
65+
66+
const success_url = new URL("/classroom", request.url);
67+
success_url.searchParams.append("join_success", classroom.id.toString());
6868
return NextResponse.redirect(success_url);
6969
}

components/ui/card.tsx

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,24 @@ import * as React from "react";
22

33
import { cn } from "@/lib/utils";
44

5-
6-
export interface CardProps
7-
extends React.HTMLAttributes<HTMLDivElement> {
5+
export interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
86
animated?: boolean;
97
}
108

11-
12-
const Card = React.forwardRef<
13-
HTMLDivElement,
14-
CardProps
15-
>(({ className,animated = false, ...props }, ref) => (
16-
<div
17-
ref={ref}
18-
className={cn(
19-
animated ? "shadow-input row-span-1 flex flex-col justify-between space-y-4 rounded-xl border border-neutral-200 bg-white p-4 transition duration-200 hover:shadow-xl dark:border-white/[0.2] dark:bg-black dark:shadow-none"
20-
: "rounded-lg border bg-card text-card-foreground shadow-sm",
21-
className
22-
)}
23-
{...props}
24-
/>
25-
));
9+
const Card = React.forwardRef<HTMLDivElement, CardProps>(
10+
({ className, animated = false, ...props }, ref) => (
11+
<div
12+
ref={ref}
13+
className={cn(
14+
animated
15+
? "row-span-1 flex flex-col justify-between space-y-4 rounded-xl border border-neutral-200 bg-white p-4 shadow-input transition duration-200 hover:shadow-xl dark:border-white/[0.2] dark:bg-black dark:shadow-none"
16+
: "rounded-lg border bg-card text-card-foreground shadow-sm",
17+
className
18+
)}
19+
{...props}
20+
/>
21+
)
22+
);
2623
Card.displayName = "Card";
2724

2825
const CardHeader = React.forwardRef<

components/ui/dialog.tsx

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
"use client"
1+
"use client";
22

3-
import * as React from "react"
4-
import * as DialogPrimitive from "@radix-ui/react-dialog"
5-
import { X } from "lucide-react"
3+
import * as React from "react";
4+
import * as DialogPrimitive from "@radix-ui/react-dialog";
5+
import { X } from "lucide-react";
66

7-
import { cn } from "@/lib/utils"
7+
import { cn } from "@/lib/utils";
88

9-
const Dialog = DialogPrimitive.Root
9+
const Dialog = DialogPrimitive.Root;
1010

11-
const DialogTrigger = DialogPrimitive.Trigger
11+
const DialogTrigger = DialogPrimitive.Trigger;
1212

13-
const DialogPortal = DialogPrimitive.Portal
13+
const DialogPortal = DialogPrimitive.Portal;
1414

15-
const DialogClose = DialogPrimitive.Close
15+
const DialogClose = DialogPrimitive.Close;
1616

1717
const DialogOverlay = React.forwardRef<
1818
React.ElementRef<typeof DialogPrimitive.Overlay>,
@@ -26,8 +26,8 @@ const DialogOverlay = React.forwardRef<
2626
)}
2727
{...props}
2828
/>
29-
))
30-
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName
29+
));
30+
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
3131

3232
const DialogContent = React.forwardRef<
3333
React.ElementRef<typeof DialogPrimitive.Content>,
@@ -50,8 +50,8 @@ const DialogContent = React.forwardRef<
5050
</DialogPrimitive.Close>
5151
</DialogPrimitive.Content>
5252
</DialogPortal>
53-
))
54-
DialogContent.displayName = DialogPrimitive.Content.displayName
53+
));
54+
DialogContent.displayName = DialogPrimitive.Content.displayName;
5555

5656
const DialogHeader = ({
5757
className,
@@ -64,8 +64,8 @@ const DialogHeader = ({
6464
)}
6565
{...props}
6666
/>
67-
)
68-
DialogHeader.displayName = "DialogHeader"
67+
);
68+
DialogHeader.displayName = "DialogHeader";
6969

7070
const DialogFooter = ({
7171
className,
@@ -78,8 +78,8 @@ const DialogFooter = ({
7878
)}
7979
{...props}
8080
/>
81-
)
82-
DialogFooter.displayName = "DialogFooter"
81+
);
82+
DialogFooter.displayName = "DialogFooter";
8383

8484
const DialogTitle = React.forwardRef<
8585
React.ElementRef<typeof DialogPrimitive.Title>,
@@ -93,8 +93,8 @@ const DialogTitle = React.forwardRef<
9393
)}
9494
{...props}
9595
/>
96-
))
97-
DialogTitle.displayName = DialogPrimitive.Title.displayName
96+
));
97+
DialogTitle.displayName = DialogPrimitive.Title.displayName;
9898

9999
const DialogDescription = React.forwardRef<
100100
React.ElementRef<typeof DialogPrimitive.Description>,
@@ -105,8 +105,8 @@ const DialogDescription = React.forwardRef<
105105
className={cn("text-sm text-muted-foreground", className)}
106106
{...props}
107107
/>
108-
))
109-
DialogDescription.displayName = DialogPrimitive.Description.displayName
108+
));
109+
DialogDescription.displayName = DialogPrimitive.Description.displayName;
110110

111111
export {
112112
Dialog,
@@ -119,4 +119,4 @@ export {
119119
DialogFooter,
120120
DialogTitle,
121121
DialogDescription,
122-
}
122+
};

components/ui/label.tsx

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

3-
import * as React from "react"
4-
import * as LabelPrimitive from "@radix-ui/react-label"
5-
import { cva, type VariantProps } from "class-variance-authority"
3+
import * as React from "react";
4+
import * as LabelPrimitive from "@radix-ui/react-label";
5+
import { cva, type VariantProps } from "class-variance-authority";
66

7-
import { cn } from "@/lib/utils"
7+
import { cn } from "@/lib/utils";
88

99
const labelVariants = cva(
1010
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
11-
)
11+
);
1212

1313
const Label = React.forwardRef<
1414
React.ElementRef<typeof LabelPrimitive.Root>,
@@ -20,7 +20,7 @@ const Label = React.forwardRef<
2020
className={cn(labelVariants(), className)}
2121
{...props}
2222
/>
23-
))
24-
Label.displayName = LabelPrimitive.Root.displayName
23+
));
24+
Label.displayName = LabelPrimitive.Root.displayName;
2525

26-
export { Label }
26+
export { Label };

0 commit comments

Comments
 (0)