"use client";
import Link from "next/link";
import { useTranslations } from "next-intl";
import { Package, Clock } from "lucide-react";
import { Badge } from "@/components/ui/badge";
import { Progress } from "@/components/ui/progress";
import { buttonVariants } from "@/components/ui/button";
import { cn } from "@/lib/utils";
type ScoredItem = {
recipe: {
id: string;
title: string;
description: string | null;
photos: Array<{ url: string }>;
};
matched: number;
total: number;
pct: number;
missing: string[];
usesExpiring: string[];
};
type Props = {
pantryCount: number;
scored: ScoredItem[];
};
function RecipeRow({ s }: { s: ScoredItem }) {
const t = useTranslations("canCook");
const cover = s.recipe.photos?.[0];
return (
{cover ? (
) : (
{s.recipe.title}
{s.usesExpiring.length > 0 && ({t("missing")}: {s.missing.join(", ")}{s.missing.length < s.total - s.matched ? "…" : ""}
)}{t("subtitle")}
{t("emptyPantry")}
{t("addPantryItems")}{t("subtitle", { count: pantryCount })}
{t("noMatches")}
{t("addPantryItems")}