import React, { useRef, useState } from "react"; //hook import useOutsideClickDetector from "hooks/use-outside-click-detector"; // ui import { CustomMenu } from "components/ui"; // types import { IIssueLabels } from "types"; //icons import { Component, Pencil, X } from "lucide-react"; type Props = { label: IIssueLabels; addLabelToGroup: (parentLabel: IIssueLabels) => void; editLabel: (label: IIssueLabels) => void; handleLabelDelete: () => void; }; export const SingleLabel: React.FC = ({ label, addLabelToGroup, editLabel, handleLabelDelete }) => { const [isMenuActive, setIsMenuActive] = useState(false); const actionSectionRef = useRef(null); useOutsideClickDetector(actionSectionRef, () => setIsMenuActive(false)); return (
{label.name}
setIsMenuActive(!isMenuActive)}>
} > addLabelToGroup(label)}> Convert to group editLabel(label)}> Edit label
); };