import { Card } from "@/components/ui/card"; import { Separator } from "@/components/ui/separator"; import { Star } from "lucide-react"; interface ProductProperty { name: string; value: string; } interface ProductInfoCardProps { name: string; brandName?: string; stock?: number; barcode?: string; colour?: string; properties?: ProductProperty[]; description?: string; averageRating: number; reviewsCount: number; t: (key: string, params?: any) => string; } export function ProductInfoCard({ name, brandName, stock, barcode, colour, properties, description, averageRating, reviewsCount, t, }: ProductInfoCardProps) { return (

{name}

{brandName && ( <>
{t("brands")} {brandName}
)} {stock !== undefined && ( <>
{t("stock")} {stock === 0 ? t("out_of_stock") : stock <= 5 ? `${t("only_left", { count: stock })}` : stock}
)} {barcode && ( <>
{t("barcode")} {barcode}
)} {colour && ( <>
{t("color")} {colour}
)} {properties && properties.length > 0 && ( <> {properties.map( (prop, idx) => prop.value && (
{prop.name} {prop.value}
{idx < properties.length - 1 && }
) )} )}
{description && (

{t("product_description")}

)}
); }