update 15/01
This commit is contained in:
@@ -11,13 +11,18 @@ import ArticleHome from "@/components/article/home";
|
||||
export default async function SlugPage({
|
||||
params,
|
||||
}: {
|
||||
params: { slug: string };
|
||||
params: Promise<{ slug: string }>;
|
||||
}) {
|
||||
const { slug } = await params;
|
||||
if (!slug) return notFound();
|
||||
|
||||
const { slug } = await params;
|
||||
if (!slug) {
|
||||
notFound();
|
||||
}
|
||||
|
||||
const result = findBySlug(slug);
|
||||
if (!result) return notFound();
|
||||
|
||||
if (!result) {
|
||||
notFound();
|
||||
}
|
||||
|
||||
switch (result.type) {
|
||||
case "product_category":
|
||||
@@ -36,6 +41,7 @@ export default async function SlugPage({
|
||||
return <ArticleDetail slug={result.data.slug} />;
|
||||
|
||||
default:
|
||||
return notFound();
|
||||
const _exhaustive: never = result;
|
||||
notFound();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,21 @@
|
||||
import Link from "next/link"
|
||||
|
||||
export default function NotFound() {
|
||||
return (
|
||||
<div style={{ padding: 40 }}>
|
||||
<h1>404</h1>
|
||||
<p>Trang không tồn tại</p>
|
||||
<div className="error-page bg-white py-10">
|
||||
<div className="container">
|
||||
<div className="text-18 text-dark text-center pt-4 pb-5">
|
||||
<img src="/images/404-page-1.png" alt="Không tìm thấy" width={1} height={1} className="block w-auto h-auto m-auto" style={{ maxWidth: 600 }} />
|
||||
<h1 className="text-36 mt-5"> Không Tìm Thấy </h1>
|
||||
<p className="py-4">
|
||||
Xin lỗi, nhưng trang bạn yêu cầu không tìm thấy hoặc đã bị xóa bỏ. Vui lòng thử lại.
|
||||
</p>
|
||||
<Link className="red" href="https://hoanghapc.vn">
|
||||
<b>← Quay lại trang chủ</b>
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user