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;
|
id: string;
|
||||||
label: string;
|
label: string;
|
||||||
icon: React.ComponentType<{ className?: string }>;
|
icon: React.ComponentType<{ className?: string }>;
|
||||||
|
/** Live Graph analytics in this panel (Meta only today). */
|
||||||
|
metrics: boolean;
|
||||||
}[] = [
|
}[] = [
|
||||||
{ id: 'instagram', label: 'Instagram', icon: Instagram },
|
{ id: 'instagram', label: 'Instagram', icon: Instagram, metrics: true },
|
||||||
{ id: 'facebook', label: 'Facebook', icon: Facebook },
|
{ id: 'facebook', label: 'Facebook', icon: Facebook, metrics: true },
|
||||||
{ id: 'linkedin', label: 'LinkedIn', icon: Linkedin },
|
{ id: 'linkedin', label: 'LinkedIn', icon: Linkedin, metrics: false },
|
||||||
{ id: 'tiktok', label: 'TikTok', icon: Share2 },
|
{ id: 'tiktok', label: 'TikTok', icon: Share2, metrics: false },
|
||||||
];
|
];
|
||||||
|
|
||||||
function n(v?: number | null) {
|
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
|
En los gráficos, la flecha es el cambio del primer al último día
|
||||||
(no es un MoM).
|
(no es un MoM).
|
||||||
</p>
|
</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>
|
</HelpDetails>
|
||||||
|
|
||||||
<div className="grid grid-cols-2 lg:grid-cols-5 gap-3">
|
<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">
|
<ul className="grid gap-3 sm:grid-cols-2">
|
||||||
{CHANNELS.map((ch) => {
|
{CHANNELS.map((ch) => {
|
||||||
const row = by.get(ch.id);
|
const row = by.get(ch.id);
|
||||||
const connected =
|
const linked =
|
||||||
row?.status === 'connected' && Boolean(row.external_account_id);
|
Boolean(row?.external_account_id) &&
|
||||||
|
(row?.status === 'connected' || row?.status === 'pending');
|
||||||
|
const live = linked && ch.metrics;
|
||||||
const Icon = ch.icon;
|
const Icon = ch.icon;
|
||||||
const url =
|
const url =
|
||||||
row?.meta?.public_url ||
|
row?.meta?.public_url ||
|
||||||
(row?.external_account_id?.startsWith('http')
|
(row?.external_account_id?.startsWith('http')
|
||||||
? row.external_account_id
|
? row.external_account_id
|
||||||
: null);
|
: 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 (
|
return (
|
||||||
<li
|
<li
|
||||||
key={ch.id}
|
key={ch.id}
|
||||||
@@ -714,13 +731,9 @@ export default function SocialDashboard({
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<span
|
<span
|
||||||
className={`text-[10px] font-bold uppercase tracking-wide px-2 py-0.5 rounded ${
|
className={`text-[10px] font-bold uppercase tracking-wide px-2 py-0.5 rounded ${badge.cls}`}
|
||||||
connected
|
|
||||||
? 'bg-emerald-50 text-emerald-700'
|
|
||||||
: 'bg-gray-100 text-gray-500'
|
|
||||||
}`}
|
|
||||||
>
|
>
|
||||||
{connected ? 'Conectado' : 'Sin enlazar'}
|
{badge.text}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<p className="text-xs text-gray-600 truncate">
|
<p className="text-xs text-gray-600 truncate">
|
||||||
@@ -729,6 +742,12 @@ export default function SocialDashboard({
|
|||||||
row?.external_account_id ||
|
row?.external_account_id ||
|
||||||
'—'}
|
'—'}
|
||||||
</p>
|
</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 && (
|
{url && (
|
||||||
<a
|
<a
|
||||||
href={url}
|
href={url}
|
||||||
|
|||||||
Reference in New Issue
Block a user