update
This commit is contained in:
17
src/app/[slug]/page.tsx
Normal file
17
src/app/[slug]/page.tsx
Normal file
@@ -0,0 +1,17 @@
|
||||
'use client';
|
||||
import { useParams } from 'next/navigation';
|
||||
import { productCategoryData } from '@/data/product/category';
|
||||
|
||||
// import component
|
||||
import CategoryPage from '@components/layout/product/Category';
|
||||
|
||||
export default function DynamicPage() {
|
||||
const params = useParams();
|
||||
const slug = ('/' + params?.slug) as string;
|
||||
|
||||
if (productCategoryData.find((c) => c.current_category.url == slug)) {
|
||||
return <CategoryPage slug={slug} />;
|
||||
}
|
||||
|
||||
return <div>404 Không tìm thấy</div>;
|
||||
}
|
||||
Reference in New Issue
Block a user