import React, { useEffect, useState } from "react"; import ModalSettings from "../UI/ModalSettings/ModalSettings"; import link from "../../images/link.svg"; import archiveSet from "../../images/archive.svg"; import del from "../../images/delete.svg"; import edit from "../../images/edit.svg"; // import {apiRequest} from "../../api/request"; import {useDispatch} from "react-redux"; import { setProjectBoardFetch } from "../../redux/projectsTrackerSlice"; import "./projectTiket.scss"; export const ProjectTiket = ({ project, index, setOpenProject }) => { const [modalSettings, setModalSettings] = useState(false); const dispatch = useDispatch(); useEffect(() => { initListeners(); }, []); function initListeners() { document.addEventListener("click", closeByClickingOut); } function closeByClickingOut(event) { const path = event.path || (event.composedPath && event.composedPath()); if ( event && !path.find((item) => item.classList && item.classList.contains("project")) ) { setModalSettings(false); } } return (

{ setOpenProject(true) dispatch(setProjectBoardFetch(project.id)) }}>{project.name}

Открытые задачи

- {/*{project.columns.length ? '+' : ''}*/} setModalSettings(true)}> ...

редактировать

ссылка на проект

в архив

удалить

); }; export default ProjectTiket;