diff --git a/apps/web/app/(app)/messages/page.tsx b/apps/web/app/(app)/messages/page.tsx index e9f2635..76fbb43 100644 --- a/apps/web/app/(app)/messages/page.tsx +++ b/apps/web/app/(app)/messages/page.tsx @@ -1,10 +1,16 @@ import type { Metadata } from "next"; +import { headers } from "next/headers"; import { MessageCircle } from "lucide-react"; +import { auth } from "@/lib/auth/server"; import { ConversationsList } from "@/components/social/conversations-list"; +import { getMessages } from "@/lib/i18n/server"; export const metadata: Metadata = { title: "Messages — Epicure" }; -export default function MessagesPage() { +export default async function MessagesPage() { + const session = await auth.api.getSession({ headers: await headers() }); + const m = getMessages((session?.user as { locale?: string } | undefined)?.locale); + return (
Select a conversation
+{m.messages.selectConversation}
Search for cooks to follow by name or username.
+{m.people.subtitle}
{drink.description}
{drink.examples.length > 0 && (- e.g. + {t("drinksExamplesLabel")} {drink.examples.join(" · ")}
)} @@ -153,7 +153,7 @@ export function DrinkPairingButton({ recipeId }: { recipeId: string }) {{error}
}{error}
} @@ -84,27 +85,27 @@ export function NutritionPanel({ recipeId, initialData }: NutritionPanelProps) {- Estimating nutrition… + {t("estimatingNutrition")}
{renderContentWithMentions(comment.content)}
Loading…
+{tCommon("loading")}
) : topLevel.length === 0 ? ( -No comments yet. Be the first!
+{t("noCommentsYet")}
) : (Loading…
; + if (loading) return{t("loading")}
; if (conversations.length === 0) { - returnNo conversations yet. Visit a profile to say hi.
; + return{t("noConversationsYet")}
; } return ( @@ -58,7 +60,7 @@ export function ConversationsList() {0 && "font-semibold")}> - {c.otherUser?.name ?? "Unknown"} + {c.otherUser?.name ?? t("unknownUser")}
{c.unreadCount > 0 && (0 ? "text-foreground" : "text-muted-foreground")}> - {c.lastMessage ?? "No messages yet"} + {c.lastMessage ?? t("noMessagesPreview")}
Loading…
+{t("loading")}
) : messages.length === 0 ? ( -No messages yet. Say hi!
+{t("noMessagesYet")}
) : ( messages.map((m) => { const isOwn = m.senderId === currentUserId; @@ -103,7 +105,7 @@ export function MessageThread({ void send(); } }} - placeholder="Type a message…" + placeholder={t("placeholder")} rows={1} className="resize-none" /> diff --git a/apps/web/components/social/people-search.tsx b/apps/web/components/social/people-search.tsx index e1e5f0f..5f0198d 100644 --- a/apps/web/components/social/people-search.tsx +++ b/apps/web/components/social/people-search.tsx @@ -2,6 +2,7 @@ import { useEffect, useState } from "react"; import Link from "next/link"; +import { useTranslations } from "next-intl"; import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"; import { Input } from "@/components/ui/input"; import { FollowButton } from "@/components/social/follow-button"; @@ -16,6 +17,7 @@ type PersonResult = { }; export function PeopleSearch() { + const t = useTranslations("people"); const [q, setQ] = useState(""); const [results, setResults] = useStateSearching…
} + {loading &&{t("searching")}
} {!loading && q.trim().length >= 2 && results.length === 0 && ( -No one found.
+{t("noneFound")}
)}