Skip to content

Commit b6dc283

Browse files
committed
Fix next linter error.
1 parent 590fc8f commit b6dc283

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

app/author/[slug]/page.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ import { AnimatedContainer, AnimatedElement, AnimatedSection } from "@/component
77
import { notFound } from "next/navigation";
88

99
interface AuthorPageProps {
10-
params: { slug: string };
11-
searchParams?: { page?: string };
10+
params: Promise<{ slug: string }>;
11+
searchParams: Promise<{ page?: string }>;
1212
}
1313

14-
export async function generateMetadata({ params }: { params: { slug: string } }) {
15-
const { slug } = params;
14+
export async function generateMetadata({ params }: { params: Promise<{ slug: string }> }) {
15+
const { slug } = await params;
1616
const author = await getAuthorBySlug(slug);
1717

1818
if (!author) {
@@ -48,7 +48,8 @@ export async function generateMetadata({ params }: { params: { slug: string } })
4848
}
4949

5050
export default async function AuthorPage({ params, searchParams }: AuthorPageProps) {
51-
const { slug } = params;
51+
const { slug } = await params;
52+
const { page } = await searchParams;
5253

5354
if (!slug) notFound();
5455

@@ -57,7 +58,7 @@ export default async function AuthorPage({ params, searchParams }: AuthorPagePro
5758

5859
const posts = await getBlogPostsByAuthor(slug);
5960
const ITEMS_PER_PAGE = 6;
60-
const currentPage = Math.max(1, parseInt(searchParams?.page || "1", 10));
61+
const currentPage = Math.max(1, parseInt(page || "1", 10));
6162
const totalPages = Math.ceil(posts.length / ITEMS_PER_PAGE);
6263
const paginatedPosts = posts.slice(
6364
(currentPage - 1) * ITEMS_PER_PAGE,
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"use client";
22
import * as LucideIcons from "lucide-react";
3+
import type { ComponentType } from "react";
34

45
interface DocIconProps {
56
iconName?: string;
@@ -10,8 +11,9 @@ interface DocIconProps {
1011
export function DocIcon({ iconName, className = "", size = 24 }: DocIconProps) {
1112
if (!iconName) return null;
1213

13-
const IconComponent = (
14-
LucideIcons as Record<string, React.ComponentType<{ className?: string; size?: number }>>
15-
)[iconName];
14+
const IconComponent = (LucideIcons as any)[iconName] as
15+
| ComponentType<{ className?: string; size?: number }>
16+
| undefined;
17+
1618
return IconComponent ? <IconComponent className={className} size={size} /> : null;
1719
}

components/team/TeamMember.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export default function TeamMember({ member }: TeamMemberProps) {
4747

4848
{/* Member roles */}
4949
{(member.team_roles?.data ?? []).map((role, roleIndex) => (
50-
<p key={`${member.id}-role-${roleIndex}`}>{role.name}</p>
50+
<p key={`${member.documentId ?? member.name}-role-${roleIndex}`}>{role.name}</p>
5151
))}
5252

5353
{/* Social links with hover animations */}

0 commit comments

Comments
 (0)