monaco-editor-lsp-next/src/components/creater/edit-detail-panel.tsx
fly6516 cc1025ded5 feat(问题编辑): add problem-editor page
- 添加了编辑问题描述、解决方案、详细信息、代码模板和测试用例的组件
- 实现了问题编辑页面的基本布局和功能
- 增加了富文本预览和对比功能
- 支持多种编程语言的代码编辑- 提供了测试用例的添加和删除功能
2025-06-20 16:51:28 +08:00

67 lines
2.0 KiB
TypeScript

"use client";
import { useState } from "react";
import { Label } from "@/components/ui/label";
import { Input } from "@/components/ui/input";
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
import { Button } from "@/components/ui/button";
interface EditDetailPanelProps {
problemId: string;
}
export const EditDetailPanel = ({
problemId,
}: EditDetailPanelProps) => {
const [displayId, setDisplayId] = useState(problemId);
const [difficulty, setDifficulty] = useState("medium");
const [isPublished, setIsPublished] = useState(true);
return (
<div className="space-y-6">
<div className="space-y-2">
<Label htmlFor="display-id"></Label>
<Input
id="display-id"
value={displayId}
onChange={(e) => setDisplayId(e.target.value)}
placeholder="输入题号"
/>
</div>
<div className="space-y-2">
<Label htmlFor="difficulty"></Label>
<Select value={difficulty} onValueChange={setDifficulty}>
<SelectTrigger id="difficulty">
<SelectValue placeholder="选择难度" />
</SelectTrigger>
<SelectContent>
<SelectItem value="easy"></SelectItem>
<SelectItem value="medium"></SelectItem>
<SelectItem value="hard"></SelectItem>
</SelectContent>
</Select>
</div>
<div className="flex items-center space-x-2">
<Label htmlFor="is-published" className="text-sm font-normal">
</Label>
<Input
id="is-published"
type="checkbox"
checked={isPublished}
onChange={(e) => setIsPublished(e.target.checked)}
className="h-4 w-4"
/>
</div>
<div className="flex space-x-2">
<Button></Button>
<Button variant="outline" type="button">
</Button>
</div>
</div>
);
};