19 | A place where even you can find a 20 | friend. 21 |
22 |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 |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 |The page you are looking for does not exist.
6 |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 |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 |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 |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 |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 |No comments yet.
50 | )} 51 | {status === "error" && ( 52 |53 | An error occurred while loading comments. 54 |
55 | )} 56 |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 | -------------------------------------------------------------------------------- /src/components/posts/PostMoreButton.tsx: -------------------------------------------------------------------------------- 1 | import { PostData } from "@/lib/types"; 2 | import { MoreHorizontal, Trash2 } from "lucide-react"; 3 | import { useState } from "react"; 4 | import { Button } from "../ui/button"; 5 | import { 6 | DropdownMenu, 7 | DropdownMenuContent, 8 | DropdownMenuItem, 9 | DropdownMenuTrigger, 10 | } from "../ui/dropdown-menu"; 11 | import DeletePostDialog from "./DeletePostDialog"; 12 | 13 | interface PostMoreButtonProps { 14 | post: PostData; 15 | className?: string; 16 | } 17 | 18 | export default function PostMoreButton({ 19 | post, 20 | className, 21 | }: PostMoreButtonProps) { 22 | const [showDeleteDialog, setShowDeleteDialog] = useState(false); 23 | 24 | return ( 25 | <> 26 |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/ui/input.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react" 2 | 3 | import { cn } from "@/lib/utils" 4 | 5 | export interface InputProps 6 | extends React.InputHTMLAttributes