import { useNavigate, useParams } from "react-router-dom"; import { useRecoilValue } from "recoil"; import { projectsAtom } from "../store"; import ImageGallery from "react-image-gallery"; import Tags from "../components/Tags"; import { IoChevronBackOutline as BackButton } from "react-icons/io5"; function ExperianceDetail() { const { id } = useParams(); const experianceList = useRecoilValue(projectsAtom); const navigate = useNavigate(); //shorter variant of Find function with IF-sats const myProject = experianceList.find((item) => item.id === id); if (myProject === undefined) { return (
404 the project does not exists
); } const projectImg = myProject.img.map((item) => { return { original: item, thumbnail: item }; }); let linkUI = <>; if (myProject.link !== undefined) { linkUI = ( Visit page ); } return (

Project: {myProject.title}

{" "}
{myProject.info}
{linkUI}
{" "}
); } 4; export default ExperianceDetail;