Not Found
5 |The page you are looking for does not exist.
6 |The page you are looking for does not exist.
6 |19 | A place where even you can find a 20 | friend. 21 |
22 |41 | No one has posted anything yet. 42 |
43 | ); 44 | } 45 | 46 | if (status === "error") { 47 | return ( 48 |49 | An error occurred while loading posts. 50 |
51 | ); 52 | } 53 | 54 | return ( 55 |41 | You don't have any bookmarks yet. 42 |
43 | ); 44 | } 45 | 46 | if (status === "error") { 47 | return ( 48 |49 | An error occurred while loading bookmarks. 50 |
51 | ); 52 | } 53 | 54 | return ( 55 |41 | No posts found. Start following people to see their posts here. 42 |
43 | ); 44 | } 45 | 46 | if (status === "error") { 47 | return ( 48 |49 | An error occurred while loading posts. 50 |
51 | ); 52 | } 53 | 54 | return ( 55 |45 | This user hasn't posted anything yet. 46 |
47 | ); 48 | } 49 | 50 | if (status === "error") { 51 | return ( 52 |53 | An error occurred while loading posts. 54 |
55 | ); 56 | } 57 | 58 | return ( 59 |48 | No posts found for this query. 49 |
50 | ); 51 | } 52 | 53 | if (status === "error") { 54 | return ( 55 |56 | An error occurred while loading posts. 57 |
58 | ); 59 | } 60 | 61 | return ( 62 |No comments yet.
50 | )} 51 | {status === "error" && ( 52 |53 | An error occurred while loading comments. 54 |
55 | )} 56 |64 | You don't have any notifications yet. 65 |
66 | ); 67 | } 68 | 69 | if (status === "error") { 70 | return ( 71 |72 | An error occurred while loading notifications. 73 |
74 | ); 75 | } 76 | 77 | return ( 78 |52 | You're not authorized to view this page. 53 |
54 | ); 55 | } 56 | 57 | const post = await getPost(postId, user.id); 58 | 59 | return ( 60 |93 | {user.displayName} 94 |
95 |96 | @{user.username} 97 |
98 |57 | {user.displayName} 58 |
59 |60 | @{user.username} 61 |
62 |116 | {hashtag} 117 |
118 |119 | {formatNumber(count)} {count === 1 ? "post" : "posts"} 120 |
121 | 122 | ); 123 | })} 124 |57 | You're not authorized to view this page. 58 |
59 | ); 60 | } 61 | 62 | const user = await getUser(username, loggedInUser.id); 63 | 64 | return ( 65 |163 | {body} 164 |
165 | ) 166 | }) 167 | FormMessage.displayName = "FormMessage" 168 | 169 | export { 170 | useFormField, 171 | Form, 172 | FormItem, 173 | FormLabel, 174 | FormControl, 175 | FormDescription, 176 | FormMessage, 177 | FormField, 178 | } 179 | -------------------------------------------------------------------------------- /src/components/posts/Post.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import { useSession } from "@/app/(main)/SessionProvider"; 4 | import { PostData } from "@/lib/types"; 5 | import { cn, formatRelativeDate } from "@/lib/utils"; 6 | import { Media } from "@prisma/client"; 7 | import { MessageSquare } from "lucide-react"; 8 | import Image from "next/image"; 9 | import Link from "next/link"; 10 | import { useState } from "react"; 11 | import Comments from "../comments/Comments"; 12 | import Linkify from "../Linkify"; 13 | import UserAvatar from "../UserAvatar"; 14 | import UserTooltip from "../UserTooltip"; 15 | import BookmarkButton from "./BookmarkButton"; 16 | import LikeButton from "./LikeButton"; 17 | import PostMoreButton from "./PostMoreButton"; 18 | 19 | interface PostProps { 20 | post: PostData; 21 | } 22 | 23 | export default function Post({ post }: PostProps) { 24 | const { user } = useSession(); 25 | 26 | const [showComments, setShowComments] = useState(false); 27 | 28 | return ( 29 |Unsupported media type
; 146 | } 147 | 148 | interface CommentButtonProps { 149 | post: PostData; 150 | onClick: () => void; 151 | } 152 | 153 | function CommentButton({ post, onClick }: CommentButtonProps) { 154 | return ( 155 | 162 | ); 163 | } 164 | --------------------------------------------------------------------------------