chore(telemetry): added for DELETE_BRAIN (#457)

This commit is contained in:
Stan Girard 2023-07-02 18:59:15 +02:00 committed by GitHub
parent 8bb8c21e04
commit a6aecea76c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,12 +1,13 @@
/* eslint-disable */
import { useEffect, useRef, useState } from "react";
import { FaBrain } from "react-icons/fa";
import { IoMdAdd, IoMdTrash } from "react-icons/io";
import { IoMdAdd } from "react-icons/io";
import Button from "@/lib/components/ui/Button";
import Field from "@/lib/components/ui/Field";
import { useBrainContext } from "@/lib/context/BrainProvider/hooks/useBrainContext";
import { useEventTracking } from "@/services/analytics/useEventTracking";
import { UUID } from "crypto";
import { AnimatePresence, motion } from "framer-motion";
import { MdCheck, MdDelete } from "react-icons/md";
@ -47,6 +48,11 @@ export const BrainsDropDown = (): JSX.Element => {
setNewBrainName(value);
};
const deteleBrains = (id: UUID) => {
void track("DELETE_BRAIN");
deleteBrain(id);
};
useEffect(() => {
document.addEventListener("mousedown", handleClickOutside);
@ -123,7 +129,7 @@ export const BrainsDropDown = (): JSX.Element => {
</button>
<Button
className="group-hover:opacity-100 opacity-0 absolute right-0 hover:text-red-500 transition-[colors,opacity]"
onClick={() => deleteBrain(brain.id)}
onClick={() => deteleBrains(brain.id)}
variant={"tertiary"}
>
<MdDelete className="text-xl" />