Skip to content

Commit 98948fb

Browse files
committed
feat: update post title
1 parent b911386 commit 98948fb

File tree

1 file changed

+4
-1
lines changed
  • apps/web/@/molecules/posts/post-item

1 file changed

+4
-1
lines changed

apps/web/@/molecules/posts/post-item/index.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import Image from "next/image"
22
import Link from "next/link"
33

44
import { TPostItem } from "database"
5+
import { useTranslations } from "next-intl"
56
import { Typography } from "ui"
67

78
import APP_ROUTES from "@/constants/routes"
@@ -14,6 +15,8 @@ import LikeButton from "./like-button"
1415
import PostMeta from "./post-meta"
1516

1617
export default function PostItem({ post }: { post: TPostItem }) {
18+
const t = useTranslations("common")
19+
1720
return (
1821
<div className="mb-4 flex rounded-sm border px-8 py-4">
1922
<div className="flex-1">
@@ -26,7 +29,7 @@ export default function PostItem({ post }: { post: TPostItem }) {
2629
variant="h2"
2730
className="hover:underline"
2831
>
29-
{post.title}
32+
{post.title || t("untitled")}
3033
</Typography>
3134
</Link>
3235

0 commit comments

Comments
 (0)