feat: add community sorting/filtering and quote post input
This commit is contained in:
@@ -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")} />
|
||||
|
||||
Reference in New Issue
Block a user