import { ProductRailSection } from "@/components/sections/shared/product-rail-section";
import { hasRealProductDiscount } from "@/lib/storefront-pricing";
import { getFeaturedProducts } from "@/lib/starter-data";

export async function FeaturedProductsSection() {
  const products = (await getFeaturedProducts()).filter(hasRealProductDiscount);

  if (products.length === 0) {
    return null;
  }

  return (
    <ProductRailSection title="Proizvodi na akciji" products={products} />
  );
}
