feat(lager): dedup per forvaringsplats + tydlig Ta bort per rad

Skann-bekraftelse slar bara ihop dubbletter inom SAMMA plats (mjolk i
kyl != mjolk i frys) + hoppar over tomma poster. Lagerlistan far en
tydlig 'Ta bort' direkt pa varje rad (inte bara via markering).
This commit is contained in:
Claude
2026-08-19 23:33:32 +00:00
parent c6c82ea520
commit 122122f10a
2 changed files with 21 additions and 5 deletions
+13 -3
View File
@@ -1,5 +1,5 @@
import { useMemo, useState } from "react";
import { Alert, View } from "react-native";
import { Alert, Pressable, View } from "react-native";
import { useLocalSearchParams } from "expo-router";
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
import { api } from "@/lib/api";
@@ -193,12 +193,22 @@ export default function KitchenScreen() {
onPress={() => toggle(item.id)}
style={isSel ? { borderColor: colors.primary, backgroundColor: colors.primarySoft } : undefined}
>
<Row style={{ justifyContent: "space-between" }}>
<Row style={{ justifyContent: "space-between", alignItems: "center" }}>
<Body>
{isSel ? "☑ " : "☐ "}
{item.displayName} · {formatQuantity(item.quantity, item.unit)}
</Body>
{item.expiry.pastBestBefore && <Small> bäst före</Small>}
<Row style={{ alignItems: "center", gap: 12 }}>
{item.expiry.pastBestBefore && <Small> bäst före</Small>}
<Pressable
onPress={() => confirmDelete([item.id], locLabel(item.locationType))}
hitSlop={8}
>
<Small style={{ color: colors.danger, fontWeight: "600" }}>
{t("common.remove")}
</Small>
</Pressable>
</Row>
</Row>
</Card>
);