18 lines
491 B
TypeScript
18 lines
491 B
TypeScript
|
|
'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>;
|
||
|
|
}
|