"use client";
import React from "react";
import { Card, CardContent } from "@/components/ui/card";
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
import {
Heart,
MessageCircle,
Repeat2,
Share,
MoreHorizontal,
ExternalLink,
Calendar,
MapPin,
} from "lucide-react";
import { cn } from "@/lib/utils";
export interface XPostProps {
title: string;
content: string;
className?: string;
}
export function XPost({ title, content, className }: XPostProps) {
const formatNumber = (num: number): string => {
if (num >= 1000000) {
return (num / 1000000).toFixed(1) + "M";
} else if (num >= 1000) {
return (num / 1000).toFixed(1) + "K";
}
return num.toString();
};
// Default values for demo purposes
const defaultAuthor = {
name: "DeepMind Research",
handle: "deepmind_research",
avatar: "/placeholder-user.jpg",
verified: true,
};
const defaultTimestamp = "2h";
const defaultLocation = "London, UK";
const defaultLikes = 1247;
const defaultRetweets = 89;
const defaultReplies = 23;
const defaultViews = 45600;
return (
{/* Header */}
{defaultAuthor.name.charAt(0)}
{defaultAuthor.name}
{defaultAuthor.verified && (
)}
@{defaultAuthor.handle}
·
{defaultTimestamp}
{defaultLocation}
{formatNumber(defaultViews)} views
{/* Title */}
{title}
{/* Content */}
{/* Action Bar */}
{formatNumber(defaultReplies)}
{formatNumber(defaultRetweets)}
{formatNumber(defaultLikes)}
);
}
// X Logo Component
export function XLogo({ className }: { className?: string }) {
return (
);
}
// X Post Preview Component (for the canvas)
export function XPostPreview({
title,
content,
}: {
title: string;
content: string;
}) {
// const samplePost = {
// title: "AI Research Breakthrough",
// content: "🚀 Exciting breakthrough in AI research! Our latest paper on multimodal reasoning shows significant improvements in complex problem-solving tasks. The integration of vision and language models opens new possibilities for scientific discovery.\n\n#AI #Research #DeepMind #Breakthrough"
// }
return (
);
}
// Compact X Post Component (for chat UI)
export function XPostCompact({ title, content, className }: XPostProps) {
const formatNumber = (num: number): string => {
if (num >= 1000000) {
return (num / 1000000).toFixed(1) + "M";
} else if (num >= 1000) {
return (num / 1000).toFixed(1) + "K";
}
return num.toString();
};
// Default values for demo purposes
const defaultAuthor = {
name: "DeepMind Research",
handle: "deepmind_research",
avatar: "/placeholder-user.jpg",
verified: true,
};
const defaultTimestamp = "2h";
const defaultLocation = "London, UK";
const defaultLikes = 1247;
const defaultRetweets = 89;
const defaultReplies = 23;
const defaultViews = 45600;
return (
{/* Compact Indicator */}
{/* [Compact Version]
*/}
{/* Header */}
{defaultAuthor.name.charAt(0)}
{defaultAuthor.name}
{defaultAuthor.verified && (
)}
@{defaultAuthor.handle}
·
{defaultTimestamp}
{defaultLocation}
{formatNumber(defaultViews)} views
{/* Title */}
{title}
{/* Content */}
{/* Action Bar */}
{formatNumber(defaultReplies)}
{formatNumber(defaultRetweets)}
{formatNumber(defaultLikes)}
);
}