refactor(DatabsTab): remove unnecessary product fetching and pass empty props to components
This commit is contained in:
@@ -1,13 +1,9 @@
|
||||
import { fetchJson } from '../../../lib/api';
|
||||
import type { Product } from '../../../features/inventory/types';
|
||||
import MergePreviewForm from '../../admin/products/MergePreviewForm';
|
||||
import AdminProductList from '../../admin/products/AdminProductList';
|
||||
import ExpandableCreateProductSection from '../../admin/products/ExpandableCreateProductSection';
|
||||
import ResetProductsButton from '../../admin/products/ResetProductsButton';
|
||||
|
||||
export default async function DatabsTab() {
|
||||
const products = await fetchJson<Product[]>('/api/products');
|
||||
|
||||
return (
|
||||
<div>
|
||||
<p style={{ color: '#555', marginBottom: '1.5rem' }}>
|
||||
@@ -15,8 +11,8 @@ export default async function DatabsTab() {
|
||||
</p>
|
||||
<ExpandableCreateProductSection />
|
||||
<ResetProductsButton />
|
||||
<MergePreviewForm products={products} />
|
||||
<AdminProductList products={products} />
|
||||
<MergePreviewForm />
|
||||
<AdminProductList />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user