Label LinkedIn/TikTok as a saved profile, not live social metrics.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -240,11 +240,13 @@ const CHANNELS: {
|
||||
id: string;
|
||||
label: string;
|
||||
icon: React.ComponentType<{ className?: string }>;
|
||||
/** Live Graph analytics in this panel (Meta only today). */
|
||||
metrics: boolean;
|
||||
}[] = [
|
||||
{ id: 'instagram', label: 'Instagram', icon: Instagram },
|
||||
{ id: 'facebook', label: 'Facebook', icon: Facebook },
|
||||
{ id: 'linkedin', label: 'LinkedIn', icon: Linkedin },
|
||||
{ id: 'tiktok', label: 'TikTok', icon: Share2 },
|
||||
{ id: 'instagram', label: 'Instagram', icon: Instagram, metrics: true },
|
||||
{ id: 'facebook', label: 'Facebook', icon: Facebook, metrics: true },
|
||||
{ id: 'linkedin', label: 'LinkedIn', icon: Linkedin, metrics: false },
|
||||
{ id: 'tiktok', label: 'TikTok', icon: Share2, metrics: false },
|
||||
];
|
||||
|
||||
function n(v?: number | null) {
|
||||
@@ -575,6 +577,11 @@ export default function SocialDashboard({
|
||||
En los gráficos, la flecha es el cambio del primer al último día
|
||||
(no es un MoM).
|
||||
</p>
|
||||
<p>
|
||||
Instagram y Facebook sí tienen métricas (Graph API). LinkedIn y
|
||||
TikTok, si aparecen, son solo el perfil guardado en la ficha:
|
||||
aún no hay evolución de impresiones ni seguidores.
|
||||
</p>
|
||||
</HelpDetails>
|
||||
|
||||
<div className="grid grid-cols-2 lg:grid-cols-5 gap-3">
|
||||
@@ -693,14 +700,24 @@ export default function SocialDashboard({
|
||||
<ul className="grid gap-3 sm:grid-cols-2">
|
||||
{CHANNELS.map((ch) => {
|
||||
const row = by.get(ch.id);
|
||||
const connected =
|
||||
row?.status === 'connected' && Boolean(row.external_account_id);
|
||||
const linked =
|
||||
Boolean(row?.external_account_id) &&
|
||||
(row?.status === 'connected' || row?.status === 'pending');
|
||||
const live = linked && ch.metrics;
|
||||
const Icon = ch.icon;
|
||||
const url =
|
||||
row?.meta?.public_url ||
|
||||
(row?.external_account_id?.startsWith('http')
|
||||
? row.external_account_id
|
||||
: null);
|
||||
const badge = !linked
|
||||
? { text: 'Sin enlazar', cls: 'bg-gray-100 text-gray-500' }
|
||||
: live
|
||||
? { text: 'Métricas en vivo', cls: 'bg-emerald-50 text-emerald-700' }
|
||||
: {
|
||||
text: 'Perfil guardado',
|
||||
cls: 'bg-amber-50 text-amber-800',
|
||||
};
|
||||
return (
|
||||
<li
|
||||
key={ch.id}
|
||||
@@ -714,13 +731,9 @@ export default function SocialDashboard({
|
||||
</p>
|
||||
</div>
|
||||
<span
|
||||
className={`text-[10px] font-bold uppercase tracking-wide px-2 py-0.5 rounded ${
|
||||
connected
|
||||
? 'bg-emerald-50 text-emerald-700'
|
||||
: 'bg-gray-100 text-gray-500'
|
||||
}`}
|
||||
className={`text-[10px] font-bold uppercase tracking-wide px-2 py-0.5 rounded ${badge.cls}`}
|
||||
>
|
||||
{connected ? 'Conectado' : 'Sin enlazar'}
|
||||
{badge.text}
|
||||
</span>
|
||||
</div>
|
||||
<p className="text-xs text-gray-600 truncate">
|
||||
@@ -729,6 +742,12 @@ export default function SocialDashboard({
|
||||
row?.external_account_id ||
|
||||
'—'}
|
||||
</p>
|
||||
{linked && !ch.metrics ? (
|
||||
<p className="text-[11px] text-gray-500">
|
||||
Hay un enlace de página en la ficha. No se leen
|
||||
impresiones, seguidores ni interacciones todavía.
|
||||
</p>
|
||||
) : null}
|
||||
{url && (
|
||||
<a
|
||||
href={url}
|
||||
|
||||
Reference in New Issue
Block a user