Skip to content

Commit d52b92b

Browse files
committed
fix(build): resolve compile regressions
1 parent 59c425c commit d52b92b

File tree

4 files changed

+22
-10
lines changed

4 files changed

+22
-10
lines changed

src/app/topics/page.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const metadata: Metadata = {
2222
type SearchParamsShape = Record<string, string | string[] | undefined>;
2323

2424
type TopicsPageProps = {
25-
searchParams?: SearchParamsShape | Promise<SearchParamsShape>;
25+
searchParams?: Promise<SearchParamsShape>;
2626
};
2727

2828
const footerLinks = [
@@ -229,10 +229,7 @@ const normalizeParam = (value: string | string[] | undefined) =>
229229
(Array.isArray(value) ? value[0] : value) ?? null;
230230

231231
export default async function TopicsPage({ searchParams }: TopicsPageProps) {
232-
const resolvedSearchParams: SearchParamsShape =
233-
searchParams && typeof (searchParams as Promise<unknown>).then === 'function'
234-
? await (searchParams as Promise<SearchParamsShape>)
235-
: (searchParams ?? {});
232+
const resolvedSearchParams: SearchParamsShape = searchParams ? await searchParams : {};
236233

237234
const rawTopic = normalizeParam(resolvedSearchParams.topic);
238235
const rawQuery = normalizeParam(resolvedSearchParams.q);

src/components/admin/CommentsModeration.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,8 @@ export const CommentsModeration = ({
187187
<AlertDialogHeader>
188188
<AlertDialogTitle>Delete comment?</AlertDialogTitle>
189189
<AlertDialogDescription>
190-
This will permanently delete this comment from {comment.authorName}. This action cannot be undone.
190+
This will permanently delete this comment from {comment.authorDisplayName ?? 'this reader'}. This
191+
action cannot be undone.
191192
</AlertDialogDescription>
192193
</AlertDialogHeader>
193194
<AlertDialogFooter>

src/components/ui/alert-dialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ function AlertDialogCancel({
138138
}: React.ComponentProps<typeof AlertDialogPrimitive.Cancel>) {
139139
return (
140140
<AlertDialogPrimitive.Cancel
141-
className={cn(buttonVariants({ variant: "neutral" }), className)}
141+
className={cn(buttonVariants({ variant: "outline" }), className)}
142142
{...props}
143143
/>
144144
)

src/components/ui/calendar.tsx

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use client"
22

33
import * as React from "react"
4-
import { ChevronLeft, ChevronRight } from "lucide-react"
4+
import { ChevronDown, ChevronLeft, ChevronRight, ChevronUp } from "lucide-react"
55
import { DayPicker } from "react-day-picker"
66

77
import { buttonVariants } from "@/components/ui/button"
@@ -75,8 +75,22 @@ function Calendar({
7575
),
7676
}}
7777
components={{
78-
IconLeft: ({ ...props }) => <ChevronLeft className="h-4 w-4" {...props} />,
79-
IconRight: ({ ...props }) => <ChevronRight className="h-4 w-4" {...props} />,
78+
Chevron: ({ orientation, className, disabled, ...iconProps }) => {
79+
const iconClassName = cn("h-4 w-4", className)
80+
void disabled
81+
82+
switch (orientation) {
83+
case "left":
84+
return <ChevronLeft className={iconClassName} {...iconProps} />
85+
case "up":
86+
return <ChevronUp className={iconClassName} {...iconProps} />
87+
case "down":
88+
return <ChevronDown className={iconClassName} {...iconProps} />
89+
case "right":
90+
default:
91+
return <ChevronRight className={iconClassName} {...iconProps} />
92+
}
93+
},
8094
}}
8195
{...props}
8296
/>

0 commit comments

Comments
 (0)