mirror of
https://github.com/snowykami/neo-blog.git
synced 2025-09-26 19:16:24 +00:00
♻️ refactor: standardize code formatting and improve readability across components
- Updated component files to use consistent single quotes for strings. - Removed unnecessary newlines and adjusted indentation for better readability. - Simplified conditional rendering and improved code structure in various components. - Added ESLint configuration for better code quality and adherence to standards. - Enhanced error handling in i18n request logic.
This commit is contained in:
@ -1,13 +1,14 @@
|
||||
import { getPostById } from "@/api/post";
|
||||
import BlogPost from "@/components/blog-post";
|
||||
import { getPostById } from '@/api/post'
|
||||
import BlogPost from '@/components/blog-post'
|
||||
|
||||
interface Props {
|
||||
params: Promise<{ id: string }>
|
||||
}
|
||||
|
||||
export default async function PostPage({ params }: Props) {
|
||||
const { id } = await params;
|
||||
const post = await getPostById(id);
|
||||
if (!post) return <div>文章不存在</div>;
|
||||
return <BlogPost post={post} />;
|
||||
}
|
||||
const { id } = await params
|
||||
const post = await getPostById(id)
|
||||
if (!post)
|
||||
return <div>文章不存在</div>
|
||||
return <BlogPost post={post} />
|
||||
}
|
||||
|
Reference in New Issue
Block a user