"use client"; import { Card, CardContent } from "@app/components/ui/card"; import { build } from "@server/build"; import { usePaidStatus } from "@app/hooks/usePaidStatus"; import { ExternalLink, KeyRound, Sparkles } from "lucide-react"; import { useTranslations } from "next-intl"; import Link from "next/link"; import { useEnvContext } from "@app/hooks/useEnvContext"; import { Tier } from "@server/types/Tiers"; const bannerClassName = "mb-6 border-primary/30 bg-linear-to-br from-primary/10 via-background to-background overflow-hidden"; const bannerContentClassName = "py-3 px-4"; const bannerRowClassName = "flex items-center gap-2.5 text-sm text-muted-foreground"; type Props = { tiers: Tier[]; }; export function PaidFeaturesAlert({ tiers }: Props) { const t = useTranslations(); const { hasSaasSubscription, hasEnterpriseLicense } = usePaidStatus(); const { env } = useEnvContext(); if (env.flags.disableEnterpriseFeatures) { return null; } return ( <> {build === "saas" && !hasSaasSubscription(tiers) ? ( {t("subscriptionRequiredToUse")} ) : null} {build === "enterprise" && !hasEnterpriseLicense ? ( {t("licenseRequiredToUse")} ) : null} {build === "oss" && !hasEnterpriseLicense ? ( {t.rich("ossEnterpriseEditionRequired", { enterpriseEditionLink: (chunks) => ( {chunks} ) })} ) : null} > ); }