import React from "react"; import { Box, Text, useColorModeValue } from "@chakra-ui/react"; import UserProfilePopup from "../profile/UserProfilePopup"; import { nanoid } from "@reduxjs/toolkit"; import { useNavigate } from "react-router-dom"; import OtherPostItem from "../post/OtherPostItem"; import { useAuth } from "../../context/auth"; const DetailRightContent = ({ currentUserProfile, otherPosts, userId, display, m, trandingOnDevCommunity, }) => { const navigate = useNavigate(); const user = useAuth(); const cardColor = useColorModeValue( "light.cardSecondaryBg", "dark.cardSecondaryBg" ); const nameColor = useColorModeValue( "light.headingHover", "dark.headingHover" ); const postsToShow = otherPosts.length !== 0 ? otherPosts : trandingOnDevCommunity; return ( {otherPosts.length ? "More from" : "Trending on"}{" "} otherPosts.length ? navigate(`/${currentUserProfile.username}`) : navigate("/") } > {otherPosts.length ? currentUserProfile.name : "DEV Community 👩‍💻👨‍💻🔥"} {postsToShow.map((postData, idx) => ( ))} ); }; export default DetailRightContent;