import { Input } from "../../ui/input"; import { Textarea } from "../../shared/ui/textarea"; import { Label } from "../../shared/ui/label"; import { Button } from "../../shared/ui/button"; import less from "./SkillTree.module.less"; import { Switch } from "../../shared/ui/switch"; import { Link } from "react-router-dom"; import { ToastAction } from "../../shared/ui/toast"; import { useToast } from "../../shared/ui/use-toast"; import { buttonVariants } from "../../ui/button"; import { addEvent, deleteEvent, submitRegister } from "../../widgets/Header/AuthAPI"; import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "../../ui/card"; import { TrashIcon } from "lucide-react"; import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, DialogTrigger, } from "../../shared/ui/dialog"; import { t } from "i18next"; import { useEffect, useState } from "react"; import { eventList } from "../AdminEventPage/AdminEventAPI"; const SkillTree = () => { const { toast } = useToast(); const [events, setEvents] = useState([]); useEffect(() => { eventList() .then((data) => { setEvents(data); }) .catch((error) => { console.error("Возникла ошибка с получением:", error); }); }, []); return (

Create event

addEvent(event)}>