import { EyeIcon, HeartIcon, PencilIcon, Trash2Icon } from "lucide-react" import { cn } from "@/lib/utils" import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar" import { Badge } from "@/components/ui/badge" import { Button } from "@/components/ui/button" import { Card } from "@/components/ui/card" import { StatusBadge } from "@/components/hexa/status-badge" interface PostCardAuthor { name: string role?: string avatarUrl?: string } interface PostCardProps { imageUrl?: string title: string description: string tag?: string author: PostCardAuthor published: boolean likes: number createdAt: string liked?: boolean onToggleLike?: () => void onView?: () => void onEdit?: () => void onDelete?: () => void className?: string } function PostCard({ imageUrl, title, description, tag, author, published, likes, createdAt, liked, onToggleLike, onView, onEdit, onDelete, className, }: PostCardProps) { return ( {imageUrl && (
{/* eslint-disable-next-line @next/next/no-img-element */}
)}

{title}

{published ? "Published" : "Draft"}

{description}

{tag && ( {tag} )}
{author.name.slice(0, 1)}

{author.name}

{author.role && (

{author.role}

)}
{onToggleLike ? ( ) : ( {likes} )} {createdAt}
{(onView || onEdit || onDelete) && (
{onView && ( )} {onEdit && ( )} {onDelete && ( )}
)}
) } export { PostCard } export type { PostCardAuthor }