add username
This commit is contained in:
parent
e29b68a907
commit
e0a2224544
1 changed files with 7 additions and 1 deletions
|
@ -1,4 +1,5 @@
|
||||||
import { Post } from '../model/posts/posts.ts'
|
import { Post } from '../model/posts/posts.ts'
|
||||||
|
import { Link } from 'react-router'
|
||||||
|
|
||||||
interface PostItemProps {
|
interface PostItemProps {
|
||||||
post: Post
|
post: Post
|
||||||
|
@ -15,7 +16,12 @@ export default function PostItem({ post }: PostItemProps) {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<article className="w-full p-4" key={post.postId}>
|
<article className="w-full p-4" key={post.postId}>
|
||||||
<div className="text-sm text-gray-500 mb-3">{formattedDate}</div>
|
<div className="text-sm text-gray-500 mb-3">
|
||||||
|
<Link to={`/u/${post.authorName}`} className="text-gray-400 hover:underline mr-2">
|
||||||
|
@{post.authorName}
|
||||||
|
</Link>
|
||||||
|
• {formattedDate}
|
||||||
|
</div>
|
||||||
|
|
||||||
<div className="text-gray-800 mb-4 whitespace-pre-wrap">{post.content}</div>
|
<div className="text-gray-800 mb-4 whitespace-pre-wrap">{post.content}</div>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue