Add sorting by name functionality and implement AdminProductList component for product management

This commit is contained in:
Nils-Johan Gynther
2026-04-10 19:10:50 +02:00
parent 33cb4e5328
commit 556a0fdc30
5 changed files with 172 additions and 40 deletions
+5 -2
View File
@@ -98,8 +98,9 @@ export default async function InventoryPage({ searchParams }: InventoryPageProps
const locationOptions = ['', 'Kyl', 'Frys', 'Skafferi'];
const sortOptions = [
{ value: '', label: 'Senast tillagda' },
{ value: 'bestBeforeAsc', label: 'Bäst före Stigande' },
{ value: 'bestBeforeDesc', label: 'Bäst före Fallande' },
{ value: 'nameAsc', label: 'Namn A\u2013\u00d6' },
{ value: 'bestBeforeAsc', label: 'B\u00e4st f\u00f6re Stigande' },
{ value: 'bestBeforeDesc', label: 'B\u00e4st f\u00f6re Fallande' },
];
return (
@@ -131,6 +132,7 @@ export default async function InventoryPage({ searchParams }: InventoryPageProps
<Link
key={option || 'alla'}
href={buildInventoryUrl(option || undefined, sort || undefined)}
scroll={false}
style={{
padding: '0.45rem 0.75rem',
borderRadius: '999px',
@@ -158,6 +160,7 @@ export default async function InventoryPage({ searchParams }: InventoryPageProps
<Link
key={option.value || 'default'}
href={buildInventoryUrl(location || undefined, option.value || undefined)}
scroll={false}
style={{
padding: '0.45rem 0.75rem',
borderRadius: '999px',