import type { LiveBlogUpdate as ApiLiveBlogUpdate } from '@/lib/api';
import { Button } from '@/components/ui/button';
import { cn } from '@/lib/utils';
import {
Pin,
PinOff,
Edit,
Trash2,
Clock,
User
} from 'lucide-react';
interface LiveBlogUpdateProps {
update: ApiLiveBlogUpdate;
isEditing?: boolean;
onEdit?: (update: ApiLiveBlogUpdate) => void;
onDelete?: (update: ApiLiveBlogUpdate) => void;
onPinToggle?: (update: ApiLiveBlogUpdate) => void;
showAdminControls?: boolean;
}
export function LiveBlogUpdate({
update,
isEditing = false,
onEdit,
onDelete,
onPinToggle,
showAdminControls = false,
}: LiveBlogUpdateProps) {
const isPinned = update.isPinned;
return (
{/* Pinned indicator */}
{isPinned && (
)}
{/* Admin controls */}
{showAdminControls && (
)}
{update.author ? (
<>
{update.author.avatar ? (

) : (
)}
{update.author.name}
{update.author.slug && (
@{update.author.slug}
)}
>
) : (
Anonymous
)}
{new Date(update.createdAt).toLocaleTimeString()}
{/* Update content */}
{isEditing ? (
) : (
{update.content}
)}
{/* Scheduled indicator */}
{update.scheduledAt && new Date(update.scheduledAt) > new Date() && (
Scheduled for: {new Date(update.scheduledAt).toLocaleString()}
)}
{/* Update metadata */}
ID: {update.id.slice(0, 8)}
);
}