feat: remove create skill in evaluation page
This commit is contained in:
@@ -11,10 +11,9 @@ import {
|
|||||||
DialogTrigger,
|
DialogTrigger,
|
||||||
} from "@/components/ui/dialog";
|
} from "@/components/ui/dialog";
|
||||||
import { Input } from "@/components/ui/input";
|
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 { SkillCategory, CategoryEvaluation } from "@/lib/types";
|
||||||
import { TechIcon } from "./icons/tech-icon";
|
import { TechIcon } from "./icons/tech-icon";
|
||||||
import { CreateSkillForm } from "./create-skill-form";
|
|
||||||
|
|
||||||
interface SkillSelectorProps {
|
interface SkillSelectorProps {
|
||||||
categories: SkillCategory[];
|
categories: SkillCategory[];
|
||||||
@@ -34,7 +33,6 @@ export function SkillSelector({
|
|||||||
onRemoveSkill,
|
onRemoveSkill,
|
||||||
}: SkillSelectorProps) {
|
}: SkillSelectorProps) {
|
||||||
const [isOpen, setIsOpen] = useState(false);
|
const [isOpen, setIsOpen] = useState(false);
|
||||||
const [isCreateOpen, setIsCreateOpen] = useState(false);
|
|
||||||
const [searchTerm, setSearchTerm] = useState("");
|
const [searchTerm, setSearchTerm] = useState("");
|
||||||
const [isAddingAll, setIsAddingAll] = useState(false);
|
const [isAddingAll, setIsAddingAll] = useState(false);
|
||||||
const [addingSkillIds, setAddingSkillIds] = useState<Set<string>>(new Set());
|
const [addingSkillIds, setAddingSkillIds] = useState<Set<string>>(new Set());
|
||||||
@@ -168,40 +166,6 @@ export function SkillSelector({
|
|||||||
)}
|
)}
|
||||||
</div>
|
</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 */}
|
{/* Available Skills Grid */}
|
||||||
<div className="max-h-96 overflow-y-auto">
|
<div className="max-h-96 overflow-y-auto">
|
||||||
<div className="grid gap-2">
|
<div className="grid gap-2">
|
||||||
|
|||||||
Reference in New Issue
Block a user