chore: format project automatically before starting dev server
This commit is contained in:
@@ -4,7 +4,7 @@ import {content} from '@/data/content';
|
||||
import ProductDetails from '@/components/ProductDetails';
|
||||
import ProtectedPage from '@/components/auth/ProtectedPage';
|
||||
|
||||
type Props = { params: { id: string } };
|
||||
type Props = {params: {id: string}};
|
||||
|
||||
export function generateStaticParams() {
|
||||
return content.fa.machines.map(machine => ({id: machine.id}));
|
||||
@@ -18,5 +18,9 @@ export function generateMetadata({params}: Props): Metadata {
|
||||
|
||||
export default function ProductPage({params}: Props) {
|
||||
if (!content.fa.machines.some(machine => machine.id === params.id)) notFound();
|
||||
return <ProtectedPage><ProductDetails id={params.id}/></ProtectedPage>;
|
||||
return (
|
||||
<ProtectedPage>
|
||||
<ProductDetails id={params.id} />
|
||||
</ProtectedPage>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -6,8 +6,14 @@ export const metadata: Metadata = {title: 'همه محصولات | روبات م
|
||||
|
||||
export default function Page() {
|
||||
return (
|
||||
<Suspense fallback={<div className="min-h-screen pt-28 px-6" aria-busy="true"><div className="h-60 rounded-3xl bg-surface animate-pulse"/></div>}>
|
||||
<ProductsPage/>
|
||||
<Suspense
|
||||
fallback={
|
||||
<div className="min-h-screen pt-28 px-6" aria-busy="true">
|
||||
<div className="h-60 rounded-3xl bg-surface animate-pulse" />
|
||||
</div>
|
||||
}
|
||||
>
|
||||
<ProductsPage />
|
||||
</Suspense>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user