feat: add community sorting/filtering and quote post input

This commit is contained in:
zetaloop
2026-02-20 23:02:22 +08:00
parent a5780c8393
commit 1362a29755
2 changed files with 79 additions and 2 deletions
+24
View File
@@ -20,6 +20,7 @@ import {
SelectValue,
} from "@/components/ui/select"
import { Textarea } from "@/components/ui/textarea"
import { mockPosts } from "@/lib/mock-data"
import { useRequireAuth } from "@/lib/use-require-auth"
const postSchema = z.object({
@@ -35,6 +36,7 @@ export default function NewPostPage() {
const [postType, setPostType] = useState("normal")
const [selectedTags, setSelectedTags] = useState<string[]>([])
const [imageCount, setImageCount] = useState(0)
const [selectedQuotePostId, setSelectedQuotePostId] = useState<string | undefined>(undefined)
const {
register,
@@ -104,6 +106,28 @@ export default function NewPostPage() {
</div>
)}
{postType === "quote" && (
<div className="space-y-2">
<Label></Label>
<Select>
<SelectTrigger>
<SelectValue placeholder="选择要引用的帖子" />
</SelectTrigger>
<SelectContent>
{mockPosts.map((post) => (
<SelectItem key={post.id} value={post.id}>
{post.title}
</SelectItem>
))}
</SelectContent>
</Select>
<div className="mt-2 rounded-md border bg-muted/50 p-3 text-sm text-muted-foreground">
<p className="font-medium text-foreground"></p>
<p className="mt-1">...</p>
</div>
</div>
)}
<div className="space-y-2">
<Label htmlFor="title"></Label>
<Input id="title" placeholder="请输入帖子标题" {...register("title")} />