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 && (
Pinned
)} {/* Admin controls */} {showAdminControls && (
)}
{update.author ? ( <> {update.author.avatar ? ( {update.author.name} ) : (
)}
{update.author.name}
{update.author.slug && (
@{update.author.slug}
)}
) : (
Anonymous
)}
{new Date(update.createdAt).toLocaleTimeString()}
{/* Update content */}
{isEditing ? (