84d6cfeb07
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.
38 lines
1.3 KiB
TypeScript
38 lines
1.3 KiB
TypeScript
"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>
|
|
);
|
|
}
|