/*! ratio-ui · design system for knowledge sharing · https://github.com/losol/ratio-ui · (c) 2026 Losol AS · MPL-2.0 */
import { Button } from "../Button/Button2.js";
import { Card } from "../Card/Card2.js";
import { Link } from "../Link/Link2.js";
import "react";
import { jsx, jsxs } from "react/jsx-runtime";
//#region src/core/ProductCard/ProductCard.tsx
var ProductCard = ({ title, lead, price, href, onAddToCart, buttonText, linkComponent, image, testId, ...cardProps }) => {
	const finalButtonText = buttonText ?? "Add to Cart";
	return /* @__PURE__ */ jsxs(Card, {
		...cardProps,
		hoverEffect: true,
		className: "flex flex-col overflow-hidden",
		padding: "none",
		"data-testid": testId,
		children: [
			image && /* @__PURE__ */ jsx("div", {
				className: "w-full",
				children: image
			}),
			/* @__PURE__ */ jsxs(Link, {
				href,
				component: linkComponent,
				className: "flex-1 p-4 no-underline hover:no-underline",
				variant: void 0,
				children: [
					/* @__PURE__ */ jsx("h3", {
						className: "mb-2 text-lg font-semibold text-(--text) hover:text-(--primary) transition-colors",
						children: title
					}),
					lead && /* @__PURE__ */ jsx("p", {
						className: "mb-4 text-sm text-(--text-muted) line-clamp-2",
						children: lead
					}),
					price && /* @__PURE__ */ jsx("div", {
						className: "mb-4",
						children: /* @__PURE__ */ jsx("span", {
							className: "text-2xl font-bold text-(--text)",
							children: price
						})
					})
				]
			}),
			onAddToCart && /* @__PURE__ */ jsx("div", {
				className: "border-t border-border-1 p-4",
				children: /* @__PURE__ */ jsx(Button, {
					onClick: onAddToCart,
					variant: "primary",
					block: true,
					children: finalButtonText
				})
			})
		]
	});
};
//#endregion
export { ProductCard };

//# sourceMappingURL=ProductCard.js.map