"use client"; import Link from "next/link"; import type { CommercialProduct } from "../types"; import { resolveProductLaunchUrl } from "../types"; import { Button } from "@/components/ui"; import { FeatureLock } from "./FeatureLock"; import { pushRecent } from "../launcher-prefs"; import { enumLabel } from "../presentation"; export function ProductCard({ product, recommendationScore, tenantId, favorite, pinned, onToggleFavorite, onTogglePinned, }: { product: CommercialProduct; recommendationScore?: number; tenantId?: string; favorite?: boolean; pinned?: boolean; onToggleFavorite?: () => void; onTogglePinned?: () => void; }) { const visibilityLocked = product.visibility === "hidden" || product.status === "inactive"; const launchUrl = resolveProductLaunchUrl(product); const strategy = product.launch_strategy || "route"; const requiredCap = product.required_capabilities?.[0]; const setupHref = `/setup/${encodeURIComponent(product.product_code)}`; const markRecent = () => { pushRecent(product.product_code); }; const launchButton = launchUrl && !visibilityLocked && strategy !== "disabled" ? ( strategy === "external" ? ( ) : ( ) ) : null; return (
{product.description}
) : null} {product.trial_eligible ?امکان استفاده آزمایشی
: null}