"use client"; import { Card } from "@/components/ui/card"; import { BrandTrackerActions } from "@/components/brand-tracker-actions"; import { useT } from "@/lib/i18n"; export function BrandTrackerClient({ query, brands, tracked, alerts, trackedByBrand, limit }: { query: string | undefined; brands: any[]; tracked: any[]; alerts: any[]; trackedByBrand: Map; limit: number | null; }) { const t = useT(); return (

{t("brand.title")}

{t("brand.description")}

{tracked.length} {t("brand.trackingLabel")} · {t("brand.limitLabel")}: {limit === null ? t("brand.unlimited") : limit}
{alerts.length > 0 &&

{t("brand.newAlerts")}

{alerts.map((alert) =>
{alert.trackedBrand.brandPage.name}

{alert.title}

{alert.createdAt.toLocaleDateString("tr-TR")}
)}
}
{brands.map((brand) => { const activeAds = brand.ads.filter((ad: any) => ad.status === "ACTIVE").length; return
{brand.name.slice(0, 2).toUpperCase()}

{brand.name}

{brand.websiteDomain || brand.pageUrl || t("brand.metaPage")}

{brand._count.ads}
{t("brand.totalAds")}
{activeAds}
{t("brand.recentActive")}
{brand.niche || "—"}
{t("brand.niche")}
{brand.ads.map((ad: any) =>
{ad.headline || t("brand.headlessCreative")}{ad.mediaType} · {ad.daysRunning || "—"} {t("brand.days")}
)} {!brand.ads.length &&

{t("brand.noAdsYet")}

}
; })} {!brands.length && {t("brand.noResults")}}
); }