"use client"; import Link from "next/link"; import { useQuery } from "@tanstack/react-query"; import { xApi, videoApi } from "@/lib/api"; import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "@/components/ui/card"; import { Button } from "@/components/ui/button"; import { Badge } from "@/components/ui/badge"; import { Share2 } from "lucide-react"; // Compact stand-in for the full X/video queues on the command center — the // full queues (plus the unified history) moved to /social to avoid a // duplicated surface. Reuses the same queries the queues themselves run // (["x","posts"] / ["video","posts"]), so react-query dedups the fetch once // /social's own queues are also mounted. export function SocialSummaryCard({ className }: { className?: string }) { const { data: xPosts } = useQuery({ queryKey: ["x", "posts"], queryFn: () => xApi.listPosts(), refetchInterval: 30000, }); const { data: videoPosts } = useQuery({ queryKey: ["video", "posts"], queryFn: () => videoApi.listPosts(), refetchInterval: 30000, }); const xCount = xPosts?.length ?? 0; const videoCount = videoPosts?.length ?? 0; const total = xCount + videoCount; return ( Social {total > 0 && {total}} Held X and video drafts awaiting your approval.
{xCount} X draft{xCount === 1 ? "" : "s"} {videoCount} video draft{videoCount === 1 ? "" : "s"}
); }