Add type definition for products state in CreateRecipePage component
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
import { useState, useEffect } from 'react';
|
import { useState, useEffect } from 'react';
|
||||||
import { useRouter } from 'next/navigation';
|
import { useRouter } from 'next/navigation';
|
||||||
import { fetchJson } from '../../../lib/api';
|
import { fetchJson } from '../../../lib/api';
|
||||||
|
import type { Product } from '../../../features/inventory/types';
|
||||||
|
|
||||||
export default function CreateRecipePage() {
|
export default function CreateRecipePage() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -12,7 +13,7 @@ export default function CreateRecipePage() {
|
|||||||
instructions: '',
|
instructions: '',
|
||||||
ingredients: [{ productId: 0, quantity: '', unit: '', note: '' }],
|
ingredients: [{ productId: 0, quantity: '', unit: '', note: '' }],
|
||||||
});
|
});
|
||||||
const [products, setProducts] = useState([]);
|
const [products, setProducts] = useState<Product[]>([]);
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
const [error, setError] = useState<string | null>(null);
|
const [error, setError] = useState<string | null>(null);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user