Files
msgapp/src/app/boards/[id]/page.tsx

17 lines
556 B
TypeScript
Raw Normal View History

import { PostList } from "@/app/components/PostList";
export default async function BoardDetail({ params, searchParams }: { params: { id: string }; searchParams?: { sort?: "recent" | "popular" } }) {
const sort = searchParams?.sort ?? "recent";
return (
<div>
<div style={{ display: "flex", justifyContent: "space-between", alignItems: "center" }}>
<h1></h1>
<a href={`/posts/new?boardId=${params.id}`}><button> </button></a>
</div>
<PostList boardId={params.id} sort={sort} />
</div>
);
}