"use client"; import { Boxes } from "lucide-react"; import { useTranslation } from "react-i18next"; import { Badge } from "@/components/ui/badge"; import { Card } from "@/components/ui/card"; import type { InventoryItem } from "@/lib/inventory"; // Read-only inventory card the agent shows for listInventory; low-stock items // (at or below their reorder threshold) get a destructive badge. export function InventoryListCard({ items }: { items: InventoryItem[] }) { const { t } = useTranslation(); return (
{t("chat.lists.inventory")} {items.length}
{items.length === 0 ? (

{t("chat.lists.noInventory")}

) : (
{items.map((it) => { const low = it.stockQuantity <= it.reorderThreshold; return (
{it.name} {[it.strength, it.form].filter(Boolean).join(" ยท ")}
{it.stockQuantity} {it.unit}
); })}
)}
); }