import React, { useEffect, useState } from 'react'; import DashboardNavBar from './DashboardNavBar'; import DashboardCard from './DashboardCard'; import { projectTutorial } from '../../services/dashboard/projectTutorial'; interface Project { _id: string; projectName: string; thumbnail: string; createdBy: string; projectUuid?: string; } interface DiscardedProjects { [key: string]: Project[]; } const DashboardTutorial = () => { const [tutorialProject, setTutorialProject] = useState({}) const handleIcon = async () => { try { let tutorial = await projectTutorial() setTutorialProject(tutorial) } catch { } } const [openKebabProjectId, setOpenKebabProjectId] = useState( null ); useEffect(() => { handleIcon() }, []) const renderTrashProjects = () => { const projectList = tutorialProject[Object.keys(tutorialProject)[0]]; if (!projectList?.length) { return
No deleted projects found
; } return projectList.map((tutorials: any) => ( )); }; return (
{renderTrashProjects()}
); } export default DashboardTutorial;