"use client"
import React from "react"
import Link from "next/link"
import { LoveIcon } from "@feedgot/ui/icons/love"
import { CommentsIcon } from "@feedgot/ui/icons/comments"
import type { RequestItemData } from "@/components/requests/RequestItem"
function PostCardBase({ item, workspaceSlug, linkBase }: { item: RequestItemData; workspaceSlug: string; linkBase?: string }) {
const base = linkBase || `/workspaces/${workspaceSlug}`
const href = `${base}/requests/${item.slug}`
return (
<div className="p-3">
<div className="flex items-start gap-3">
<Link href={href} className="text-sm font-medium text-foreground hover:text-primary flex-1">
{item.title}
</Link>
<div className="inline-flex items-center gap-2 bg-muted rounded-md ring-1 ring-border px-2 py-1 text-xs text-accent">
<span className="inline-flex items-center gap-1">
<LoveIcon aria-hidden className="w-3 h-3" />
<span className="tabular-nums">{item.upvotes}</span>
</span>
<span className="inline-flex items-center gap-1">
<CommentsIcon aria-hidden className="w-3 h-3" />
<span className="tabular-nums">{item.commentCount}</span>
</span>
</div>
</div>
{item.content ? (
<p className="mt-2 text-sm text-accent truncate">{item.content}</p>
) : null}
</div>
)
}
export default React.memo(PostCardBase)
Please authenticate to join the conversation.
Planned
Feature Request
Low Priority
3 months ago

manltz
Get notified by email when there are changes.
Planned
Feature Request
Low Priority
3 months ago

manltz
Get notified by email when there are changes.