Skip to content

Commit

Permalink
chore(telemetry): added for DELETE_BRAIN (#457)
Browse files Browse the repository at this point in the history
  • Loading branch information
StanGirard authored Jul 2, 2023
1 parent 8bb8c21 commit a6aecea
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -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";

Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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" />
Expand Down

0 comments on commit a6aecea

Please sign in to comment.