fix: vídeos en Social y notas Superhuman por día desde Drive
Los docs de seguimiento son Google Docs embebidos: se exportan, se parten por fecha y se acumulan. Social renderiza VIDEO/REELS y trae vídeos de página. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -63,6 +63,7 @@ type SocialPost = {
|
||||
platform: 'facebook' | 'instagram';
|
||||
message?: string;
|
||||
mediaUrl?: string | null;
|
||||
thumbnailUrl?: string | null;
|
||||
permalink?: string | null;
|
||||
createdAt?: string | null;
|
||||
likes: number;
|
||||
@@ -73,6 +74,13 @@ type SocialPost = {
|
||||
mediaType?: string | null;
|
||||
};
|
||||
|
||||
function isVideoPost(p: SocialPost): boolean {
|
||||
const t = (p.mediaType || '').toUpperCase();
|
||||
if (t.includes('VIDEO') || t === 'REELS' || t === 'REEL') return true;
|
||||
const url = p.mediaUrl || '';
|
||||
return /\.mp4($|\?)/i.test(url) || /video/i.test(url);
|
||||
}
|
||||
|
||||
const CHANNELS: {
|
||||
id: string;
|
||||
label: string;
|
||||
@@ -307,10 +315,19 @@ export default function SocialDashboard({
|
||||
className="rounded-2xl border border-gray-200 bg-white overflow-hidden flex flex-col"
|
||||
>
|
||||
<div className="relative aspect-square bg-gray-100">
|
||||
{p.mediaUrl ? (
|
||||
{p.mediaUrl && isVideoPost(p) ? (
|
||||
<video
|
||||
src={p.mediaUrl}
|
||||
poster={p.thumbnailUrl || undefined}
|
||||
className="absolute inset-0 w-full h-full object-cover"
|
||||
controls
|
||||
playsInline
|
||||
preload="metadata"
|
||||
/>
|
||||
) : p.mediaUrl || p.thumbnailUrl ? (
|
||||
// eslint-disable-next-line @next/next/no-img-element
|
||||
<img
|
||||
src={p.mediaUrl}
|
||||
src={p.thumbnailUrl || p.mediaUrl || ''}
|
||||
alt=""
|
||||
className="absolute inset-0 w-full h-full object-cover"
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user