added empty pages

This commit is contained in:
Jelaletdin12
2025-12-15 17:55:34 +05:00
parent e886359c5c
commit 6d0064b106
22 changed files with 531 additions and 296 deletions

View File

@@ -1,32 +1,30 @@
import { Heart } from "lucide-react"
import { Button } from "@/components/ui/button"
import Link from "next/link"
import { Button } from "@/components/ui/button";
import { Heart } from "lucide-react";
import { useTranslations } from "next-intl";
import { useRouter } from "next/navigation";
interface EmptyFavoritesProps {
locale?: string
message?: string
actionText?: string
actionHref?: string
}
export default function EmptyFavorites({
locale = "ru",
message = "No favorite items yet",
actionText = "Browse Products",
actionHref = "/",
}: EmptyFavoritesProps) {
export default function EmptyFavorites() {
const t=useTranslations();
const router=useRouter();
return (
<div className="min-h-[400px] flex flex-col items-center justify-center p-4">
<Heart className="h-16 w-16 text-gray-300 mb-4" />
<h2 className="text-2xl font-semibold text-gray-600 mb-2">{message}</h2>
<p className="text-gray-500 mb-6 text-center max-w-sm">
{locale === "ru"
? "Сохраняйте понравившиеся товары, чтобы найти их позже"
: "Save items you love to find them later"}
</p>
<Link href={actionHref}>
<Button className="rounded-xl">{actionText}</Button>
</Link>
<div className="flex min-h-[60vh] items-center justify-center px-4">
<div className="w-full max-w-md rounded-2xl bg-gradient-to-br from-blue-50 to-white p-8 text-center shadow-lg">
<div className="mx-auto mb-6 flex h-20 w-20 items-center justify-center rounded-full bg-blue-100">
<Heart className="h-10 w-10 text-blue-600" />
</div>
<h2 className="mb-2 text-2xl font-semibold text-gray-900">
{t("favorites_empty")}
</h2>
<p className="mb-6 text-sm text-gray-500">
{t("favorites_empty_message")}
</p>
<Button onClick={()=>router.push("/")} className="w-full rounded-xl bg-blue-600 px-6 py-3 text-sm font-medium text-white transition hover:bg-blue-700 active:scale-95">
{t("start_shopping")}
</Button>
</div>
</div>
)
}
);
}