create banner

This commit is contained in:
amirhosein.ashourloo
2026-08-17 10:29:46 +03:30
parent 1272977923
commit e5f040d3eb
27 changed files with 832 additions and 603 deletions
+18 -13
View File
@@ -1,9 +1,10 @@
import { Carousel } from "@/components/ui/Carousel";
import { ProductCard } from "@/components/ui/ProductCard";
import { SectionTitle } from "@/components/ui/SectionTitle";
import { topSellingProducts } from "@/data/sample";
import { EmptyState } from "@/components/ui/EmptyState";
import type { Product } from "@/lib/meshkee";
export function TopSellingCarousel() {
export function TopSellingCarousel({ products }: { products: Product[] }) {
return (
<section className="py-10 md:py-14">
<div className="mx-auto max-w-7xl px-4">
@@ -12,17 +13,21 @@ export function TopSellingCarousel() {
enTitle="Top Selling"
action="مشاهده همه"
/>
<Carousel ariaLabel="کاروسل پرفروش‌ترین‌ها">
{topSellingProducts.map((product) => (
<ProductCard
key={product.id}
name={product.name}
brand={product.brand}
price={product.price}
image={product.image}
/>
))}
</Carousel>
{products.length === 0 ? (
<EmptyState message="هنوز محصولی ثبت نشده است." />
) : (
<Carousel ariaLabel="کاروسل پرفروش‌ترین‌ها">
{products.map((product) => (
<ProductCard
key={product.id}
name={product.name}
brand={product.brand ?? ""}
price={product.price}
image={product.image ?? "/images/placeholder.svg"}
/>
))}
</Carousel>
)}
</div>
</section>
);