feat: remove create skill in evaluation page
This commit is contained in:
@@ -11,10 +11,9 @@ import {
|
||||
DialogTrigger,
|
||||
} from "@/components/ui/dialog";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Plus, Search, Sparkles } from "lucide-react";
|
||||
import { Plus, Search } from "lucide-react";
|
||||
import { SkillCategory, CategoryEvaluation } from "@/lib/types";
|
||||
import { TechIcon } from "./icons/tech-icon";
|
||||
import { CreateSkillForm } from "./create-skill-form";
|
||||
|
||||
interface SkillSelectorProps {
|
||||
categories: SkillCategory[];
|
||||
@@ -34,7 +33,6 @@ export function SkillSelector({
|
||||
onRemoveSkill,
|
||||
}: SkillSelectorProps) {
|
||||
const [isOpen, setIsOpen] = useState(false);
|
||||
const [isCreateOpen, setIsCreateOpen] = useState(false);
|
||||
const [searchTerm, setSearchTerm] = useState("");
|
||||
const [isAddingAll, setIsAddingAll] = useState(false);
|
||||
const [addingSkillIds, setAddingSkillIds] = useState<Set<string>>(new Set());
|
||||
@@ -168,40 +166,6 @@ export function SkillSelector({
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Create New Skill Button */}
|
||||
<div className="border-t pt-4">
|
||||
<Dialog open={isCreateOpen} onOpenChange={setIsCreateOpen}>
|
||||
<DialogTrigger asChild>
|
||||
<Button
|
||||
variant="outline"
|
||||
className="w-full gap-2 border-dashed border-2 border-blue-300/50 text-blue-200 hover:border-blue-400 hover:bg-blue-500/10 hover:text-blue-100 transition-all duration-200"
|
||||
>
|
||||
<Sparkles className="h-4 w-4" />
|
||||
Créer une nouvelle compétence dans {selectedCategory}
|
||||
</Button>
|
||||
</DialogTrigger>
|
||||
<DialogContent className="max-w-md">
|
||||
<DialogHeader>
|
||||
<DialogTitle>Créer une nouvelle compétence</DialogTitle>
|
||||
<DialogDescription>
|
||||
Ajoutez une compétence manquante dans la catégorie{" "}
|
||||
{selectedCategory}
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
<CreateSkillForm
|
||||
categoryName={selectedCategory}
|
||||
onSuccess={(skillId) => {
|
||||
setIsCreateOpen(false);
|
||||
setIsOpen(false);
|
||||
// Ajouter automatiquement la skill créée à l'évaluation
|
||||
onAddSkill(selectedCategory, skillId);
|
||||
}}
|
||||
onCancel={() => setIsCreateOpen(false)}
|
||||
/>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
</div>
|
||||
|
||||
{/* Available Skills Grid */}
|
||||
<div className="max-h-96 overflow-y-auto">
|
||||
<div className="grid gap-2">
|
||||
|
||||
Reference in New Issue
Block a user