Remove the editorial calendar publish button.
Agency will load new months from files, not a portal CTA that copied another client’s plan. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,47 +0,0 @@
|
||||
'use client';
|
||||
|
||||
import React, { useState } from 'react';
|
||||
import { Upload } from 'lucide-react';
|
||||
|
||||
export default function PublishRrssButton() {
|
||||
const [busy, setBusy] = useState(false);
|
||||
const [msg, setMsg] = useState<string | null>(null);
|
||||
|
||||
async function publish() {
|
||||
setBusy(true);
|
||||
setMsg(null);
|
||||
try {
|
||||
const r = await fetch('/api/calendar/publish', { method: 'POST' });
|
||||
const j = await r.json();
|
||||
if (!r.ok) {
|
||||
setMsg(j.error || 'Error al publicar');
|
||||
return;
|
||||
}
|
||||
setMsg(`Publicado · ${j.pieces} piezas · ${j.month}`);
|
||||
} catch (e) {
|
||||
setMsg(e instanceof Error ? e.message : 'Error');
|
||||
} finally {
|
||||
setBusy(false);
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-1">
|
||||
<button
|
||||
type="button"
|
||||
disabled={busy}
|
||||
onClick={publish}
|
||||
className="inline-flex items-center justify-center min-h-[52px] px-6 rounded-xl border border-emerald-500/40 bg-emerald-500/15 text-emerald-300 text-sm font-bold hover:bg-emerald-500/25 disabled:opacity-50"
|
||||
>
|
||||
<Upload className="w-4 h-4 mr-2" />
|
||||
{busy ? 'Publicando…' : 'Dejar octubre visible para el cliente'}
|
||||
</button>
|
||||
<p className="text-[11px] text-gray-500 max-w-xs leading-relaxed">
|
||||
No publica en Instagram ni Facebook. Solo guarda el plan de este mes en
|
||||
el portal de <strong>Agua Miia</strong> para que el cliente lo vea en
|
||||
Calendario.
|
||||
</p>
|
||||
{msg ? <p className="text-[11px] text-gray-400">{msg}</p> : null}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -6,7 +6,6 @@ import { resolveActiveTenant, restGet } from '@/lib/tenant-context';
|
||||
import { isAgencyRole, userRole } from '@/lib/agency';
|
||||
import RrssMonthView, { RrssMonthPlan, RrssPiece } from '@/components/RrssMonthView';
|
||||
import CalendarClient from './CalendarClient';
|
||||
import PublishRrssButton from './PublishRrssButton';
|
||||
import RrssArchiveYear from '@/components/RrssArchiveYear';
|
||||
import octPlan from '@/data/rrss-octubre-2026.json';
|
||||
import { Instagram, Linkedin } from 'lucide-react';
|
||||
@@ -99,9 +98,6 @@ export default async function CalendarioPage({
|
||||
plans.push(octPlan as unknown as RrssMonthPlan);
|
||||
}
|
||||
|
||||
const canPublishMiia = agency && isAguaMiia;
|
||||
const publishBtn = canPublishMiia ? <PublishRrssButton /> : null;
|
||||
|
||||
const monthParam = sp.month || plans[0]?.month;
|
||||
const active = plans.find((p) => p.month === monthParam) || plans[0];
|
||||
// Portada = archivo anual estilo /rrss/ig-fb/
|
||||
@@ -142,7 +138,6 @@ export default async function CalendarioPage({
|
||||
>
|
||||
<Linkedin className="w-4 h-4 mr-2" /> LinkedIn
|
||||
</Link>
|
||||
{publishBtn}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
@@ -156,7 +151,6 @@ export default async function CalendarioPage({
|
||||
year={year}
|
||||
plans={plans}
|
||||
tenantLabel={ctx.label}
|
||||
agencyPublish={publishBtn}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user