Add CreateRecipePage component for recipe creation with ingredients. Updated UX
This commit is contained in:
@@ -86,15 +86,8 @@ export default async function InventoryPage({ searchParams }: InventoryPageProps
|
||||
|
||||
const inventoryPath = (() => {
|
||||
const params = new URLSearchParams();
|
||||
|
||||
if (location) {
|
||||
params.set('location', location);
|
||||
}
|
||||
|
||||
if (sort) {
|
||||
params.set('sort', sort);
|
||||
}
|
||||
|
||||
if (location) params.set('location', location);
|
||||
if (sort) params.set('sort', sort);
|
||||
const query = params.toString();
|
||||
return query ? `/api/inventory?${query}` : '/api/inventory';
|
||||
})();
|
||||
@@ -112,8 +105,25 @@ export default async function InventoryPage({ searchParams }: InventoryPageProps
|
||||
];
|
||||
|
||||
return (
|
||||
<main style={{ padding: '1.5rem', maxWidth: '900px', margin: '0 auto' }}>
|
||||
<h1>Hemmavaror</h1>
|
||||
<main style={{ padding: '1.5rem', maxWidth: '1000px', margin: '0 auto' }}>
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: '1.5rem' }}>
|
||||
<h1 style={{ margin: 0 }}>Varor hemma</h1>
|
||||
<Link
|
||||
href="/recipes/create"
|
||||
style={{
|
||||
padding: '0.5rem 1rem',
|
||||
background: '#0070f3',
|
||||
color: 'white',
|
||||
borderRadius: '4px',
|
||||
textDecoration: 'none',
|
||||
fontWeight: 500,
|
||||
fontSize: '1rem',
|
||||
transition: 'background 0.2s',
|
||||
}}
|
||||
>
|
||||
Lägg till nytt recept
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
<ProductForm />
|
||||
<InventoryForm products={products} />
|
||||
|
||||
Reference in New Issue
Block a user