feat(recipes): full recipe CRUD with photos, print, version history
List, detail, new, edit pages. Server-side pagination, dietary tags, difficulty. Photo upload to S3-compatible storage. Version history. Multi-select grid with bulk delete/visibility. Print view. Delete confirmation dialog.
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
"use client";
|
||||
import { useTranslations } from "next-intl";
|
||||
import Link from "next/link";
|
||||
import { PlusCircle } from "lucide-react";
|
||||
import { buttonVariants } from "@/components/ui/button";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
export function RecipesEmptyState({ query, count }: { query: string; count: number }) {
|
||||
const t = useTranslations("recipes");
|
||||
if (count > 0) {
|
||||
return query ? (
|
||||
<p className="text-sm text-muted-foreground">
|
||||
{count} {count !== 1 ? t("resultPlural") : t("resultSingular")} {t("for")} “{query}”
|
||||
</p>
|
||||
) : null;
|
||||
}
|
||||
return (
|
||||
<div className="flex flex-col items-center justify-center h-64 border-2 border-dashed rounded-xl gap-4">
|
||||
{query ? (
|
||||
<>
|
||||
<p className="text-muted-foreground text-sm">{t("noMatch")} “{query}”</p>
|
||||
<Link href="/recipes" className={cn(buttonVariants({ variant: "outline", size: "sm" }))}>
|
||||
{t("clearSearch")}
|
||||
</Link>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<p className="text-muted-foreground text-sm">{t("noRecipes")}</p>
|
||||
<Link href="/recipes/new" className={cn(buttonVariants({ size: "sm" }))}>
|
||||
<PlusCircle className="h-4 w-4" />
|
||||
{t("createFirst")}
|
||||
</Link>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user